From: Alex Converse Date: Thu, 29 Sep 2011 00:50:51 +0000 (-0700) Subject: prores: Handle 0 or fewer bits left X-Git-Tag: v0.8b1~1365 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fcbe421cee55e06c62d1d5d1f3cc7c522e7210a4;p=platform%2Fupstream%2Flibav.git prores: Handle 0 or fewer bits left show_bits() is undefined when the number of bits is less than or equal to zero. --- diff --git a/libavcodec/proresdec.c b/libavcodec/proresdec.c index 759c10b..c70d145 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;