dca: Validate the lfe parameter

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit a9d50bb578)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
Martin Storsjö
2013-09-19 15:12:06 +03:00
committed by Luca Barbato
parent c211ba9b59
commit 456a939210

View File

@@ -578,6 +578,11 @@ static int dca_parse_frame_header(DCAContext *s)
s->lfe = get_bits(&s->gb, 2); s->lfe = get_bits(&s->gb, 2);
s->predictor_history = get_bits(&s->gb, 1); s->predictor_history = get_bits(&s->gb, 1);
if (s->lfe > 2) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid LFE value: %d\n", s->lfe);
return AVERROR_INVALIDDATA;
}
/* TODO: check CRC */ /* TODO: check CRC */
if (s->crc_present) if (s->crc_present)
s->header_crc = get_bits(&s->gb, 16); s->header_crc = get_bits(&s->gb, 16);