avcodec/aacenc: Fix sample rate check

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/113/head^2
Michael Niedermayer 10 years ago
parent a6baef6517
commit 704c980294
  1. 2
      libavcodec/aacenc.c

@ -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);

Loading…
Cancel
Save