dds: Fix palette mode on big endian
Found-By: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
This commit is contained in:
parent
ded5957d75
commit
4d55484391
@ -626,8 +626,13 @@ static int dds_decode(AVCodecContext *avctx, void *data,
|
|||||||
int linesize = av_image_get_linesize(avctx->pix_fmt, frame->width, 0);
|
int linesize = av_image_get_linesize(avctx->pix_fmt, frame->width, 0);
|
||||||
|
|
||||||
if (ctx->paletted) {
|
if (ctx->paletted) {
|
||||||
|
int i;
|
||||||
|
uint32_t *p = (uint32_t *)frame->data[1];
|
||||||
|
|
||||||
/* Use the first 1024 bytes as palette, then copy the rest. */
|
/* 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;
|
frame->palette_has_changed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user