atrac1: validate number of channels

This commit is contained in:
Justin Ruggles 2011-10-14 00:24:50 -04:00
parent 9a35ff3841
commit bff5b2c1ca
1 changed files with 5 additions and 0 deletions

View File

@ -332,6 +332,11 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx)
avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
if (avctx->channels < 1 || avctx->channels > AT1_MAX_CHANNELS) {
av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %d\n",
avctx->channels);
return AVERROR(EINVAL);
}
q->channels = avctx->channels;
/* Init the mdct transforms */