Enforce time border monotonicity.
authorAlex Converse <alex.converse@gmail.com>
Fri, 30 Apr 2010 23:32:42 +0000 (23:32 +0000)
committerAlex Converse <alex.converse@gmail.com>
Fri, 30 Apr 2010 23:32:42 +0000 (23:32 +0000)
Thanks to Chromium.

Originally committed as revision 23000 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/aacsbr.c

index bc6cb00..130e3ed 100644 (file)
@@ -720,6 +720,13 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
         return -1;
     }
 
+    for (i = 1; i <= ch_data->bs_num_env; i++) {
+        if (ch_data->t_env[i-1] > ch_data->t_env[i]) {
+            av_log(ac->avccontext, AV_LOG_ERROR, "Non monotone time borders\n");
+            return -1;
+        }
+    }
+
     ch_data->bs_num_noise = (ch_data->bs_num_env > 1) + 1;
 
     ch_data->t_q[0]                     = ch_data->t_env[0];