From: Luca Barbato <[email protected]>

Found-By: Michael Niedermayer <[email protected]>
Signed-off-by: Vittorio Giovara <[email protected]>
---
 libavcodec/dds.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dds.c b/libavcodec/dds.c
index 9652f27..501057e 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;
         }
 
-- 
1.9.5 (Apple Git-50.3)

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to