Commit a3d2379b authored by Justin Ruggles's avatar Justin Ruggles

flacdec: Check curr_bps after wasted bits are subtracted.

Originally committed as revision 17813 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent d3f76612
...@@ -432,10 +432,6 @@ static inline int decode_subframe(FLACContext *s, int channel) ...@@ -432,10 +432,6 @@ static inline int decode_subframe(FLACContext *s, int channel)
if (s->decorrelation == LEFT_SIDE || s->decorrelation == MID_SIDE) if (s->decorrelation == LEFT_SIDE || s->decorrelation == MID_SIDE)
s->curr_bps++; 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)) { if (get_bits1(&s->gb)) {
av_log(s->avctx, AV_LOG_ERROR, "invalid subframe padding\n"); av_log(s->avctx, AV_LOG_ERROR, "invalid subframe padding\n");
...@@ -449,6 +445,10 @@ static inline int decode_subframe(FLACContext *s, int channel) ...@@ -449,6 +445,10 @@ static inline int decode_subframe(FLACContext *s, int channel)
wasted++; wasted++;
s->curr_bps -= 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 //FIXME use av_log2 for types
if (type == 0) { if (type == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment