From: Martin Storsjö Date: Tue, 4 Sep 2012 11:31:52 +0000 (+0300) Subject: proresenc: Write the full value in one put_bits call X-Git-Tag: android-x86-4.4-r1~8529^2~699 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6d9e74cd4179f42a8fa860f2e08d370c7c36325f;p=android-x86%2Fexternal-ffmpeg.git proresenc: Write the full value in one put_bits call Previously, the put_bits call writing the value wrote a value larger than the number of bits specified, failing asserts in debug mode. There was no actual bitstream writer corruption, since the overwritten bit already always was set to 1. Signed-off-by: Martin Storsjö --- diff --git a/libavcodec/proresenc.c b/libavcodec/proresenc.c index a24b7118c2..f4feed5ee4 100644 --- a/libavcodec/proresenc.c +++ b/libavcodec/proresenc.c @@ -299,8 +299,7 @@ static inline void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int exponent = av_log2(val); put_bits(pb, exponent - exp_order + switch_bits, 0); - put_bits(pb, 1, 1); - put_bits(pb, exponent, val); + put_bits(pb, exponent + 1, val); } else { exponent = val >> rice_order;