mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
mp3on4: require a minimum framesize.
If bufsize < headersize, init_get_bits() will be called with a negative number, causing it to fail and any subsequent call to get_bits() will crash because it reads from a NULL pointer. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
This commit is contained in:
parent
c0994e39d7
commit
3e13005cac
@ -1917,6 +1917,10 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data,
|
||||
m = s->mp3decctx[fr];
|
||||
assert(m != NULL);
|
||||
|
||||
if (fsize < HEADER_SIZE) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Frame size smaller than header size\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
header = (AV_RB32(buf) & 0x000fffff) | s->syncword; // patch header
|
||||
|
||||
if (ff_mpa_check_header(header) < 0) // Bad header, discard block
|
||||
|
Loading…
Reference in New Issue
Block a user