[FFmpeg-cvslog] avcodec/dds: Fix palettes on big endian

Michael Niedermayer git at videolan.org
Tue Jun 23 00:57:51 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Jun 22 23:59:28 2015 +0200| [21d2e3d602dc5f173901ba51f6a237b9dfce9e8e] | committer: Michael Niedermayer

avcodec/dds: Fix palettes on big endian

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21d2e3d602dc5f173901ba51f6a237b9dfce9e8e
---

 libavcodec/dds.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/dds.c b/libavcodec/dds.c
index 514225a..3f6f7f8 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;
         }
 



More information about the ffmpeg-cvslog mailing list