Skip to content
Snippets Groups Projects
Commit 21d2e3d6 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avcodec/dds: Fix palettes on big endian

parent ff68b839
No related branches found
No related tags found
No related merge requests found
......@@ -626,8 +626,13 @@ static int dds_decode(AVCodecContext *avctx, void *data,
int linesize = av_image_get_linesize(avctx->pix_fmt, frame->width, 0);
if (ctx->paletted) {
int i;
/* Use the first 1024 bytes as palette, then copy the rest. */
bytestream2_get_buffer(gbc, frame->data[1], 256 * 4);
if (HAVE_BIGENDIAN)
for (i = 0; i < 256; i++)
AV_WB32(frame->data[1] + i*4, AV_RL32(frame->data[1] + i*4));
frame->palette_has_changed = 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment