1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-23 18:01:50 +02:00

dcadec: check lfe field

Fix out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-12-01 21:42:02 +01:00
parent 56e149fda9
commit 3b2cd83a82

View File

@ -737,6 +737,12 @@ static int dca_parse_frame_header(DCAContext *s)
s->lfe = get_bits(&s->gb, 2);
s->predictor_history = get_bits(&s->gb, 1);
if (s->lfe == 3) {
s->lfe = 0;
av_log_ask_for_sample(s->avctx, "LFE is 3\n");
return AVERROR_PATCHWELCOME;
}
/* TODO: check CRC */
if (s->crc_present)
s->header_crc = get_bits(&s->gb, 16);