avcodec/aacenc: Fix sample rate check

Fixes out of array read
Fixes CID1257803, CID1257797, CID1257789, CID1257786

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-02-22 22:25:27 +01:00
parent a6baef6517
commit 704c980294

View File

@ -740,7 +740,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
s->channels = avctx->channels;
ERROR_IF(i == 16,
ERROR_IF(i >= 12,
"Unsupported sample rate %d\n", avctx->sample_rate);
ERROR_IF(s->channels > AAC_MAX_CHANNELS,
"Unsupported number of channels: %d\n", s->channels);