[FFmpeg-devel] [PATCH] avcodec/rawdec: check for side data before checking its size

James Almer jamrial at gmail.com
Fri Nov 4 03:34:58 EET 2016


Fixes valgrind warnings about usage of uninitialized values.

Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/rawdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index 45cf27f..e53eb2e 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -369,7 +369,7 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
                                                      &pal_size);
         int ret;
 
-        if (pal_size != AVPALETTE_SIZE) {
+        if (pal && pal_size != AVPALETTE_SIZE) {
             av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", pal_size);
             pal = NULL;
         }
-- 
2.10.1



More information about the ffmpeg-devel mailing list