Commit 496c02a0 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun
Browse files

brstm: make sure an ADPC chunk was read for adpcm_thp


This fixes NULL pointer dereferencing.
Reviewed-by: default avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: default avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit d7d37c47

)
Signed-off-by: default avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
No related merge requests found
Showing with 5 additions and 0 deletions
+5 -0
......@@ -260,6 +260,11 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
if (codec->codec_id == AV_CODEC_ID_ADPCM_THP) {
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 (av_new_packet(pkt, 8 + (32 + 4) * codec->channels + size) < 0)
return AVERROR(ENOMEM);
dst = pkt->data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment