avcodec/aacenc: Fix sample rate check
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Feb 2015 21:25:27 +0000 (22:25 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 22 Feb 2015 21:29:09 +0000 (22:29 +0100)
Fixes out of array read
Fixes CID1257803, CID1257797, CID1257789, CID1257786

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/aacenc.c

index 635123e..aa6a56a 100644 (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);