From 3b22b26e1c711f727e8e940a4b260819692d6d17 Mon Sep 17 00:00:00 2001 From: SlowRiot Date: Fri, 7 Nov 2014 02:44:27 +0000 Subject: do not check unsigned windowsize for < 0 --- lodepng.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3