[FFmpeg-cvslog] golomb: Fix overread in get_ur_golomb_jpegls()

Nir Ben David git at videolan.org
Thu Nov 10 23:33:46 CET 2011


ffmpeg | branch: master | Nir Ben David <nirbenda at gmail.com> | Thu Nov 10 23:03:48 2011 +0100| [083d9ba448e5290e71a513f027a1534e438918ab] | committer: Michael Niedermayer

golomb: Fix overread in get_ur_golomb_jpegls()
Fixes Ticket600

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=083d9ba448e5290e71a513f027a1534e438918ab
---

 libavcodec/golomb.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 8dff032..d92bc40 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);
         }



More information about the ffmpeg-cvslog mailing list