changeset 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 433a8fbbdd00
children 4a4a8563de98
files lzw.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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;