aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rawdec.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2016-11-03 22:34:58 -0300
committerJames Almer <jamrial@gmail.com>2016-12-04 17:27:07 -0300
commitd111c9ce139c83edbf4f1e0ea22bb151b8da1547 (patch)
tree16137046c230988323f2dcf6171d91f5cab0f081 /libavcodec/rawdec.c
parent6e1bc747df868b7576161b88d8561870894863b1 (diff)
downloadffmpeg-d111c9ce139c83edbf4f1e0ea22bb151b8da1547.tar.gz
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 51e329918dc1826de7451541cb15bef3b9bfe138)
Diffstat (limited to 'libavcodec/rawdec.c')
-rw-r--r--libavcodec/rawdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index f78190ea01..fbdf4810fa 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -386,7 +386,7 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
int pal_size;
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE,
&pal_size);
- 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;
}