aboutsummaryrefslogtreecommitdiffstats
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
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)
-rw-r--r--Changelog1
-rw-r--r--libavcodec/rawdec.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/Changelog b/Changelog
index 373a31b9a1..cb97baca1f 100644
--- a/Changelog
+++ b/Changelog
@@ -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;
}