aacdec: check channel count

Prevent 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 2013-01-27 20:37:27 +01:00
parent 9d602a0b0e
commit 96f452ac64
1 changed files with 5 additions and 0 deletions

View File

@ -914,6 +914,11 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
}
}
if (avctx->channels > MAX_CHANNELS) {
av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
return AVERROR_INVALIDDATA;
}
AAC_INIT_VLC_STATIC( 0, 304);
AAC_INIT_VLC_STATIC( 1, 270);
AAC_INIT_VLC_STATIC( 2, 550);