Skip to content

Commit

Permalink
dds: Fix palette mode on big endian
Browse files Browse the repository at this point in the history
Found-By: Michael Niedermayer <[email protected]>
Signed-off-by: Vittorio Giovara <[email protected]>
  • Loading branch information
lu-zero authored and kodawah committed Jun 24, 2015
1 parent ded5957 commit 4d55484
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libavcodec/dds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
uint32_t *p = (uint32_t *)frame->data[1];

/* Use the first 1024 bytes as palette, then copy the rest. */
bytestream2_get_buffer(gbc, frame->data[1], 256 * 4);
for (i = 0; i < 256; i++)
p[i] = bytestream2_get_le32(gbc);

frame->palette_has_changed = 1;
}

Expand Down

0 comments on commit 4d55484

Please sign in to comment.