aboutsummaryrefslogtreecommitdiff
path: root/libavcodec/dds.c
diff options
context:
space:
mode:
authorMichael Niedermayer2015-06-22 23:59:28 +0200
committerMichael Niedermayer2015-06-22 23:59:28 +0200
commit21d2e3d602dc5f173901ba51f6a237b9dfce9e8e (patch)
treec23509a5438c73eb7618f02959562b3a6efb410a /libavcodec/dds.c
parentff68b83968cba999a15b7c981c1bbcc2d608cad2 (diff)
avcodec/dds: Fix palettes on big endian
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dds.c')
-rw-r--r--libavcodec/dds.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/dds.c b/libavcodec/dds.c
index 514225a632..3f6f7f8cb7 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;
/* 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;
}