Commit c925e960 authored by Michael Niedermayer's avatar Michael Niedermayer

mp3on4: fail when the header check fails

It seems the code assumed that when one out of multiple blocks fail
some span of time is correct, its not, its some channels
that are correct

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f44a03ba3ce_5692_id5_1.mp4
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6433b393
......@@ -1934,8 +1934,10 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data,
}
header = (AV_RB32(buf) & 0x000fffff) | s->syncword; // patch header
if (ff_mpa_check_header(header) < 0) // Bad header, discard block
break;
if (ff_mpa_check_header(header) < 0) {
av_log(avctx, AV_LOG_ERROR, "Bad header, discard block\n");
return AVERROR_INVALIDDATA;
}
avpriv_mpegaudio_decode_header((MPADecodeHeader *)m, header);
......
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