changeset 9130:721e21aca252 libavcodec

flacdec: Check curr_bps after wasted bits are subtracted.
author jbr
date Wed, 04 Mar 2009 23:10:40 +0000
parents 913ae1f5c090
children dfa6b3358c61
files flacdec.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/flacdec.c	Wed Mar 04 21:50:10 2009 +0000
+++ b/flacdec.c	Wed Mar 04 23:10:40 2009 +0000
@@ -432,10 +432,6 @@
         if (s->decorrelation == LEFT_SIDE || s->decorrelation == MID_SIDE)
             s->curr_bps++;
     }
-    if (s->curr_bps > 32) {
-        ff_log_missing_feature(s->avctx, "decorrelated bit depth > 32", 0);
-        return -1;
-    }
 
     if (get_bits1(&s->gb)) {
         av_log(s->avctx, AV_LOG_ERROR, "invalid subframe padding\n");
@@ -449,6 +445,10 @@
             wasted++;
         s->curr_bps -= wasted;
     }
+    if (s->curr_bps > 32) {
+        ff_log_missing_feature(s->avctx, "decorrelated bit depth > 32", 0);
+        return -1;
+    }
 
 //FIXME use av_log2 for types
     if (type == 0) {