[FFmpeg-cvslog] lzw(gif): Fix overread

Michael Niedermayer git at videolan.org
Wed Mar 28 07:53:26 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Mar 28 07:25:06 2012 +0200| [11cc2092269a36dc7a98545397e110fa8c08e18a] | committer: Michael Niedermayer

lzw(gif): Fix overread

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/lzw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/lzw.c b/libavcodec/lzw.c
index 185a05d..2db0d67e 100644
--- a/libavcodec/lzw.c
+++ b/libavcodec/lzw.c
@@ -101,7 +101,7 @@ void ff_lzw_decode_tail(LZWState *p)
     struct LZWState *s = (struct LZWState *)p;
 
     if(s->mode == FF_LZW_GIF) {
-        while(s->pbuf < s->ebuf && s->bs>0){
+        while(s->pbuf + s->bs < s->ebuf && s->bs>0){
             s->pbuf += s->bs;
             s->bs = *s->pbuf++;
         }



More information about the ffmpeg-cvslog mailing list