# HG changeset patch # User jbr # Date 1236208240 0 # Node ID 721e21aca252b6c1d876c211239e9cd9f9cae885 # Parent 913ae1f5c090c2c0273ce350450ee1dd3502fc03 flacdec: Check curr_bps after wasted bits are subtracted. diff -r 913ae1f5c090 -r 721e21aca252 flacdec.c --- 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) {