diff lzw.c @ 7266:451bc2b25bcb libavcodec

check that csize in ff_lzw_decode_init is < LZW_MAXBITS, <= is not enough and might read outside the prefix array
author reimar
date Sun, 13 Jul 2008 20:03:57 +0000
parents 48759bfbd073
children 04423b2f6e0b
line wrap: on
line diff
--- a/lzw.c	Sun Jul 13 19:59:44 2008 +0000
+++ b/lzw.c	Sun Jul 13 20:03:57 2008 +0000
@@ -131,7 +131,7 @@
 {
     struct LZWState *s = (struct LZWState *)p;
 
-    if(csize < 1 || csize > LZW_MAXBITS)
+    if(csize < 1 || csize >= LZW_MAXBITS)
         return -1;
     /* read buffer */
     s->pbuf = buf;