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: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-01-02 18:45:36 +01:00
parent 6433b393ba
commit c925e960e8

View File

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