diff aacsbr.c @ 11672:f838fa3eefee libavcodec

Enforce time border monotonicity. Thanks to Chromium.
author alexc
date Fri, 30 Apr 2010 23:32:42 +0000
parents 7f301b81b503
children ed3d232c9d31
line wrap: on
line diff
--- a/aacsbr.c	Fri Apr 30 23:08:44 2010 +0000
+++ b/aacsbr.c	Fri Apr 30 23:32:42 2010 +0000
@@ -720,6 +720,13 @@
         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];