1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Handle case of get_bits(0)

Originally committed as revision 6365 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Kostya Shishkov 2006-09-28 05:01:02 +00:00
parent b86216de4c
commit 8db0c25d95

View File

@ -142,7 +142,7 @@ static always_inline int get_tail(GetBitContext *gb, int k)
if(k<1 || k>65535)return 0; if(k<1 || k>65535)return 0;
p = av_log2_16bit(k); p = av_log2_16bit(k);
e = (1 << (p + 1)) - k - 1; e = (1 << (p + 1)) - k - 1;
res = get_bits(gb, p); res = p ? get_bits(gb, p) : 0;
if(res >= e){ if(res >= e){
res = (res<<1) - e + get_bits1(gb); res = (res<<1) - e + get_bits1(gb);
} }