golomb: fix end of bitstream check

Fixes Ticket806
Bug found by Oana Stratulat

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-12-21 00:28:39 +01:00
parent 7feb7f16a8
commit fc739b79ad
1 changed files with 1 additions and 1 deletions

View File

@ -302,7 +302,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int
}else{
int i;
for(i=0; SHOW_UBITS(re, gb, 1) == 0; i++){
if (get_bits_left(gb)<=0)
if (gb->size_in_bits <= re_index)
return -1;
LAST_SKIP_BITS(re, gb, 1);
UPDATE_CACHE(re, gb);