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>
Mon, 5 Dec 2016 17:57:01 +0000 (14:57 -0300)
Fixes valgrind warnings about usage of uninitialized values.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 51e329918dc1826de7451541cb15bef3b9bfe138)

libavcodec/rawdec.c

index 2d348da..ca0927c 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;
         }