summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlowRiot <rain.backnet@gmail.com>2014-11-07 02:44:27 +0000
committerLode <lvandeve@gmail.com>2014-11-15 17:47:24 +0100
commitf87069a6e263b93345c864f4b5a4e3208de01828 (patch)
treeac2f3238c8d351d479c004635282f9b311a4fe12
parent3aad3b531ff025a6fb0000d04f528810f1c707cf (diff)
do not check unsigned windowsize for < 0
-rw-r--r--lodepng.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lodepng.cpp b/lodepng.cpp
index 2be3fbe..426236e 100644
--- a/lodepng.cpp
+++ b/lodepng.cpp
@@ -1468,7 +1468,7 @@ static unsigned encodeLZ77(uivector* out, Hash* hash,
const unsigned char *lastptr, *foreptr, *backptr;
unsigned hashpos;
- if(windowsize <= 0 || windowsize > 32768) return 60; /*error: windowsize smaller/larger than allowed*/
+ if(windowsize == 0 || windowsize > 32768) return 60; /*error: windowsize smaller/larger than allowed*/
if((windowsize & (windowsize - 1)) != 0) return 90; /*error: must be power of two*/
if(nicematch > MAX_SUPPORTED_DEFLATE_LENGTH) nicematch = MAX_SUPPORTED_DEFLATE_LENGTH;