mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
golomb: check remaining bits during unary decoding in get_ur_golomb_jpegls()
Fixes infinite loop in FLAC decoding in case of a truncated bitstream due to the safe bitstream reader returning 0's at the end. Fixes Bug 310. CC:libav-stable@libav.org
This commit is contained in:
parent
404410a53a
commit
4795362660
@ -301,7 +301,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int
|
|||||||
return buf;
|
return buf;
|
||||||
}else{
|
}else{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < limit && SHOW_UBITS(re, gb, 1) == 0; i++) {
|
for (i = 0; i < limit && SHOW_UBITS(re, gb, 1) == 0 && HAVE_BITS_REMAINING(re, gb); i++) {
|
||||||
LAST_SKIP_BITS(re, gb, 1);
|
LAST_SKIP_BITS(re, gb, 1);
|
||||||
UPDATE_CACHE(re, gb);
|
UPDATE_CACHE(re, gb);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user