From 7c0c98b504caf0463d79785acd7b173fd4846a8e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 1 Jul 2016 11:08:29 +0100 Subject: [PATCH] Addd loop guard to prevent negative bit shift --- src/osgPlugins/zip/unzip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/zip/unzip.cpp b/src/osgPlugins/zip/unzip.cpp index 0d64cc02a..88a30004e 100644 --- a/src/osgPlugins/zip/unzip.cpp +++ b/src/osgPlugins/zip/unzip.cpp @@ -2003,7 +2003,7 @@ uInt *v) // working area: values in order of bit length // backup over finished tables mask = (1 << w) - 1; // needed on HP, cc -O bug - while ((i & mask) != x[h]) + while (((i & mask) != x[h]) && (w>=l)) { h--; // don't need to update q w -= l;