prores: Handle 0 or fewer bits left

show_bits() is undefined when the number of bits is less than or equal to
zero.
This commit is contained in:
Alex Converse 2011-09-28 17:50:51 -07:00
parent fe21f78d2b
commit fcbe421cee
1 changed files with 2 additions and 2 deletions

View File

@ -427,13 +427,13 @@ static inline void decode_ac_coeffs(GetBitContext *gb, DCTELEM *out,
lev_cb_index = lev_to_cb_index[FFMIN(level, 9)];
bits_left = get_bits_left(gb);
if (bits_left <= 8 && !show_bits(gb, bits_left))
if (bits_left <= 0 || (bits_left <= 8 && !show_bits(gb, bits_left)))
return;
run = decode_vlc_codeword(gb, ac_codebook[run_cb_index]);
bits_left = get_bits_left(gb);
if (bits_left <= 8 && !show_bits(gb, bits_left))
if (bits_left <= 0 || (bits_left <= 8 && !show_bits(gb, bits_left)))
return;
level = decode_vlc_codeword(gb, ac_codebook[lev_cb_index]) + 1;