Commit fc739b79 authored by Michael Niedermayer's avatar Michael Niedermayer

golomb: fix end of bitstream check

Fixes Ticket806
Bug found by Oana Stratulat
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 7feb7f16
...@@ -302,7 +302,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int ...@@ -302,7 +302,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int
}else{ }else{
int i; int i;
for(i=0; SHOW_UBITS(re, gb, 1) == 0; 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; return -1;
LAST_SKIP_BITS(re, gb, 1); LAST_SKIP_BITS(re, gb, 1);
UPDATE_CACHE(re, gb); UPDATE_CACHE(re, gb);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment