aacsbr: fix integer overflow
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 4 Nov 2012 16:30:56 +0000 (17:30 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 4 Nov 2012 16:37:28 +0000 (17:37 +0100)
Fixes CID603186
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/aacsbr.c

index 1d15177..ceff2ea 100644 (file)
@@ -749,7 +749,7 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
         if (ch_data->bs_frame_class == FIXFIX) {
             idx = ch_data->bs_num_env >> 1;
         } else if (ch_data->bs_frame_class & 1) { // FIXVAR or VARVAR
-            idx = ch_data->bs_num_env - FFMAX(bs_pointer - 1, 1);
+            idx = ch_data->bs_num_env - FFMAX((int)bs_pointer - 1, 1);
         } else { // VARFIX
             if (!bs_pointer)
                 idx = 1;