avcodec/rawdec: check for side data before checking its size
authorJames Almer <jamrial@gmail.com>
Fri, 4 Nov 2016 01:34:58 +0000 (22:34 -0300)
committerJames Almer <jamrial@gmail.com>
Sat, 5 Nov 2016 02:38:56 +0000 (23:38 -0300)
Fixes valgrind warnings about usage of uninitialized values.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/rawdec.c

index 45cf27f..e53eb2e 100644 (file)
@@ -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;
         }