diff options
author | Alex Converse <alex.converse@gmail.com> | 2011-09-28 17:50:51 -0700 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2011-09-29 09:45:57 -0700 |
commit | fcbe421cee55e06c62d1d5d1f3cc7c522e7210a4 (patch) | |
tree | d895b87085af7e1d32c0cfcf75e9c6204302baa9 | |
parent | fe21f78d2bf1ac5b5400570a8a4031be3493aa7d (diff) | |
download | ffmpeg-fcbe421cee55e06c62d1d5d1f3cc7c522e7210a4.tar.gz |
prores: Handle 0 or fewer bits left
show_bits() is undefined when the number of bits is less than or equal to
zero.
-rw-r--r-- | libavcodec/proresdec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/proresdec.c b/libavcodec/proresdec.c index 759c10b6e5..c70d145345 100644 --- a/libavcodec/proresdec.c +++ b/libavcodec/proresdec.c @@ -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; |