OSDN Git Service

aacenc_ltp: fix assertion
authorRostislav Pehlivanov <atomnuker@gmail.com>
Sat, 17 Oct 2015 10:58:33 +0000 (11:58 +0100)
committerRostislav Pehlivanov <atomnuker@gmail.com>
Sat, 17 Oct 2015 11:00:30 +0000 (12:00 +0100)
A value of 2048 will overflow 11 bits.

libavcodec/aacenc_ltp.c

index 066e195..0bd8954 100644 (file)
@@ -101,7 +101,7 @@ void ff_aac_update_ltp(AACEncContext *s, SingleChannelElement *sce)
             lag = i;
         }
     }
-    lag = av_clip(lag, 0, 2048); /* 11 bits => 2^11 = 2048 */
+    lag = av_clip(lag, 0, 2047); /* 11 bits => 2^11 = 0->2047 */
 
     if (!lag) {
         sce->ics.ltp.lag = lag;