1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00

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 6e1bc747df
commit d111c9ce13
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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;
}