diff options
author | James Almer <jamrial@gmail.com> | 2016-11-03 22:34:58 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2016-12-04 17:27:07 -0300 |
commit | d111c9ce139c83edbf4f1e0ea22bb151b8da1547 (patch) | |
tree | 16137046c230988323f2dcf6171d91f5cab0f081 | |
parent | 6e1bc747df868b7576161b88d8561870894863b1 (diff) | |
download | ffmpeg-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)
-rw-r--r-- | Changelog | 1 | ||||
-rw-r--r-- | libavcodec/rawdec.c | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -2,6 +2,7 @@ Entries are sorted chronologically from oldest to youngest within each release, releases are sorted from youngest to oldest. version 3.0.5: +- avcodec/rawdec: check for side data before checking its size - avcodec/flacdec: Fix undefined shift in decode_subframe() - avcodec/get_bits: Fix get_sbits_long(0) - avformat/ffmdec: Check media type for chunks 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; } |