[FFmpeg-cvslog] lzw: fix potential integer overflow.

Ronald S. Bultje git at videolan.org
Fri Mar 30 22:33:27 CEST 2012


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Wed Mar 28 20:00:38 2012 -0700| [0399fe0fd23ff272282dd093cc2720deb6f87ea8] | committer: Ronald S. Bultje

lzw: fix potential integer overflow.

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

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

diff --git a/libavcodec/lzw.c b/libavcodec/lzw.c
index b674d4e..8761510 100644
--- a/libavcodec/lzw.c
+++ b/libavcodec/lzw.c
@@ -102,7 +102,7 @@ void ff_lzw_decode_tail(LZWState *p)
 
     if(s->mode == FF_LZW_GIF) {
         while (s->bs > 0) {
-            if (s->pbuf + s->bs >= s->ebuf) {
+            if (s->bs >= s->ebuf - s->pbuf) {
                 s->pbuf = s->ebuf;
                 break;
             } else {



More information about the ffmpeg-cvslog mailing list