libfdk-aacdec: Fix a boundary check
authorMartin Storsjö <martin@martin.st>
Wed, 10 Dec 2014 06:02:43 +0000 (08:02 +0200)
committerMartin Storsjö <martin@martin.st>
Wed, 10 Dec 2014 20:51:42 +0000 (22:51 +0200)
This avoids potential out of bounds writes, with potential future
versions of the library.

Bug-Id: CID 1254945
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/libfdk-aacdec.c

index 2c2abae..deef56a 100644 (file)
@@ -100,7 +100,7 @@ static int get_stream_info(AVCodecContext *avctx)
 
     for (i = 0; i < info->numChannels; i++) {
         AUDIO_CHANNEL_TYPE ctype = info->pChannelType[i];
-        if (ctype <= ACT_NONE || ctype > FF_ARRAY_ELEMS(channel_counts)) {
+        if (ctype <= ACT_NONE || ctype >= FF_ARRAY_ELEMS(channel_counts)) {
             av_log(avctx, AV_LOG_WARNING, "unknown channel type\n");
             break;
         }