[FFmpeg-soc] [soc]: r3325 - aac/aac.c

superdump subversion at mplayerhq.hu
Fri Aug 15 13:47:53 CEST 2008


Author: superdump
Date: Fri Aug 15 13:47:52 2008
New Revision: 3325

Log:
Swap logic of tns_max_order condition for clarity


Modified:
   aac/aac.c

Modified: aac/aac.c
==============================================================================
--- aac/aac.c	(original)
+++ aac/aac.c	Fri Aug 15 13:47:52 2008
@@ -738,7 +738,12 @@ static int decode_tns(AACContext * ac, T
         for (filt = 0; filt < tns->n_filt[w]; filt++) {
             tns->length[w][filt] = get_bits(gb, 6 - 2*is8);
 
-            if ((tns->order[w][filt] = get_bits(gb, 5 - 2*is8)) <= tns_max_order) {
+            if ((tns->order[w][filt] = get_bits(gb, 5 - 2*is8)) > tns_max_order) {
+                av_log(ac->avccontext, AV_LOG_ERROR, "TNS filter order %d is greater than maximum %d.",
+                       tns->order[w][filt], tns_max_order);
+                tns->order[w][filt] = 0;
+                return -1;
+            } else {
                 tns->direction[w][filt] = get_bits1(gb);
                 coef_compress = get_bits1(gb);
                 coef_len = coef_res - coef_compress;
@@ -746,11 +751,6 @@ static int decode_tns(AACContext * ac, T
 
                 for (i = 0; i < tns->order[w][filt]; i++)
                     tns->coef[w][filt][i] = get_bits(gb, coef_len);
-            } else {
-                av_log(ac->avccontext, AV_LOG_ERROR, "TNS filter order %d is greater than maximum %d.",
-                       tns->order[w][filt], tns_max_order);
-                tns->order[w][filt] = 0;
-                return -1;
             }
         }
     }



More information about the FFmpeg-soc mailing list