atrac3dec: Check coding mode against channels.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-11-09 13:26:20 +01:00
parent 5ee008e01d
commit 13451f5520

View File

@ -916,6 +916,11 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
return AVERROR(EINVAL);
}
if (q->coding_mode == JOINT_STEREO && avctx->channels < 2) {
av_log(avctx, AV_LOG_ERROR, "Invalid coding mode\n");
return AVERROR_INVALIDDATA;
}
/* Check the extradata */
if (version != 4) {