diff options
author | Anssi Hannula <anssi.hannula@iki.fi> | 2011-01-06 22:24:39 +0000 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2011-01-06 22:24:39 +0000 |
commit | df1c694c580c9e0255ce632e25afdc2ef200137e (patch) | |
tree | 6490734a4ebaf720a0dfce853e753678ee0fd6f0 /libavcodec | |
parent | d381249bb86d5a4b1a99bb292a7aed034d6d12de (diff) | |
download | ffmpeg-df1c694c580c9e0255ce632e25afdc2ef200137e.tar.gz |
Verify FSIZE96 when encountering X96 sync code.
Patch by Anssi Hannula, anssi d hannula a iki d fi
Originally committed as revision 26249 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dca.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/dca.c b/libavcodec/dca.c index 70aaa4ef58..83f529ba1a 100644 --- a/libavcodec/dca.c +++ b/libavcodec/dca.c @@ -1352,12 +1352,18 @@ static int dca_decode_frame(AVCodecContext * avctx, s->xch_present = 1; break; } - case 0x1d95f262: - av_log(avctx, AV_LOG_DEBUG, "Possible X96 extension found at %d bits\n", get_bits_count(&s->gb)); - av_log(avctx, AV_LOG_DEBUG, "FSIZE96 = %d bytes\n", get_bits(&s->gb, 12)+1); + case 0x1d95f262: { + int fsize96 = show_bits(&s->gb, 12) + 1; + if (s->frame_size != (get_bits_count(&s->gb) >> 3) - 4 + fsize96) + continue; + + av_log(avctx, AV_LOG_DEBUG, "X96 extension found at %d bits\n", get_bits_count(&s->gb)); + skip_bits(&s->gb, 12); + av_log(avctx, AV_LOG_DEBUG, "FSIZE96 = %d bytes\n", fsize96); av_log(avctx, AV_LOG_DEBUG, "REVNO = %d\n", get_bits(&s->gb, 4)); break; } + } skip_bits_long(&s->gb, (-get_bits_count(&s->gb)) & 31); } |