changeset 11672:f838fa3eefee libavcodec

Enforce time border monotonicity. Thanks to Chromium.
author alexc
date Fri, 30 Apr 2010 23:32:42 +0000
parents 7f301b81b503
children da59da296153
files aacsbr.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
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];