Commit a61f77b7 authored by conrad's avatar conrad

vp3: avoid buffer overread in coeff decode

I couldn't measure it to be slower for normal interframe videos.
For the worst case, high-bitrate intra-only videos, it can be 0.7% slower.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22416 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0477913d
...@@ -941,7 +941,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, ...@@ -941,7 +941,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
if (blocks_ended) if (blocks_ended)
dct_tokens[j++] = blocks_ended << 2; dct_tokens[j++] = blocks_ended << 2;
while (coeff_i < num_coeffs) { while (coeff_i < num_coeffs && get_bits_left(gb) > 0) {
/* decode a VLC into a token */ /* decode a VLC into a token */
token = get_vlc2(gb, vlc_table, 5, 3); token = get_vlc2(gb, vlc_table, 5, 3);
/* use the token to get a zero run, a coefficient, and an eob run */ /* use the token to get a zero run, a coefficient, and an eob run */
......
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