diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2015-06-23 13:48:10 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-06-24 14:45:16 +0100 |
commit | 4d55484391112a30d16812597b9ad81605af0c24 (patch) | |
tree | 171c2f733e672b94107de4c4c793bb857372db9b /libavcodec | |
parent | ded5957d75def70d2f1fc1c1eae079230004974b (diff) | |
download | ffmpeg-4d55484391112a30d16812597b9ad81605af0c24.tar.gz |
dds: Fix palette mode on big endian
Found-By: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dds.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/dds.c b/libavcodec/dds.c index 9652f273fc..501057e2a2 100644 --- a/libavcodec/dds.c +++ b/libavcodec/dds.c @@ -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; } |