diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-01-04 12:57:38 +0100 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-01-04 13:19:59 +0100 |
commit | d7d37c479fa71639650751648275615e979beb33 (patch) | |
tree | e241ed2c16ceda06d84626565daeaf135966abf4 /libavformat | |
parent | e7a7b3135a4e5ba4bd2e144444d95a7563f53e9b (diff) | |
download | ffmpeg-d7d37c479fa71639650751648275615e979beb33.tar.gz |
brstm: make sure an ADPC chunk was read for adpcm_thp
This fixes NULL pointer dereferencing.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/brstm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/brstm.c b/libavformat/brstm.c index bbdbcef6cb..6ec4d89438 100644 --- a/libavformat/brstm.c +++ b/libavformat/brstm.c @@ -389,6 +389,11 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) codec->codec_id == AV_CODEC_ID_ADPCM_THP_LE) { uint8_t *dst; + if (!b->adpc) { + av_log(s, AV_LOG_ERROR, "adpcm_thp requires ADPC chunk, but none was found.\n"); + return AVERROR_INVALIDDATA; + } + if (size > (INT_MAX - 32 - 4) || (32 + 4 + size) > (INT_MAX / codec->channels) || (32 + 4 + size) * codec->channels > INT_MAX - 8) |