lzw: fix potential integer overflow.
authorRonald S. Bultje <rsbultje@gmail.com>
Thu, 29 Mar 2012 03:00:38 +0000 (20:00 -0700)
committerRonald S. Bultje <rsbultje@gmail.com>
Thu, 29 Mar 2012 18:36:14 +0000 (11:36 -0700)
libavcodec/lzw.c

index b674d4e..8761510 100644 (file)
@@ -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 {