From 083d9ba448e5290e71a513f027a1534e438918ab Mon Sep 17 00:00:00 2001 From: Nir Ben David Date: Thu, 10 Nov 2011 23:03:48 +0100 Subject: golomb: Fix overread in get_ur_golomb_jpegls() Fixes Ticket600 Signed-off-by: Michael Niedermayer --- libavcodec/golomb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavcodec/golomb.h') diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index 8dff0322a7..d92bc40ee7 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -302,6 +302,8 @@ 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) + return -1; LAST_SKIP_BITS(re, gb, 1); UPDATE_CACHE(re, gb); } -- cgit v1.2.3