diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2012-02-15 09:52:11 -0800 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2012-02-16 17:08:29 -0800 |
commit | 52e4018be47697a60f4f18f83551766df31f5adf (patch) | |
tree | bdf50e94f4a6e75037256f58ea2ae6cd7358b6f9 /libavcodec/golomb.h | |
parent | b4027d97498af67313bded746b3da38915e155f5 (diff) | |
download | ffmpeg-52e4018be47697a60f4f18f83551766df31f5adf.tar.gz |
flac: fix infinite loops on all-zero input or end-of-stream.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/golomb.h')
-rw-r--r-- | libavcodec/golomb.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index e19064c642..5f720c03f3 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -301,7 +301,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int return buf; }else{ int i; - for(i=0; SHOW_UBITS(re, gb, 1) == 0; i++){ + for (i = 0; i < limit && SHOW_UBITS(re, gb, 1) == 0; i++) { LAST_SKIP_BITS(re, gb, 1); UPDATE_CACHE(re, gb); } |