From 8db0c25d9582065f208d8da1ccd28fb40c4c32e7 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Thu, 28 Sep 2006 05:01:02 +0000 Subject: [PATCH] Handle case of get_bits(0) Originally committed as revision 6365 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/wavpack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 4a4a5847e9..558e57d40e 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -142,7 +142,7 @@ static always_inline int get_tail(GetBitContext *gb, int k) if(k<1 || k>65535)return 0; p = av_log2_16bit(k); e = (1 << (p + 1)) - k - 1; - res = get_bits(gb, p); + res = p ? get_bits(gb, p) : 0; if(res >= e){ res = (res<<1) - e + get_bits1(gb); }