avcodec/rawdec: check for side data before checking its size

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 51e329918d)
This commit is contained in:
James Almer 2016-11-03 22:34:58 -03:00
parent f788507607
commit a1d9c17368
1 changed files with 1 additions and 1 deletions

View File

@ -369,7 +369,7 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
&pal_size); &pal_size);
int ret; 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); av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", pal_size);
pal = NULL; pal = NULL;
} }