Browse Source

* Patch from Filiuta Vitali to fix range check error (bug ID 0033493)

git-svn-id: trunk@38657 -
michael 7 years ago
parent
commit
df435ca138
1 changed files with 7 additions and 2 deletions
  1. 7 2
      packages/paszlib/src/infcodes.pas

+ 7 - 2
packages/paszlib/src/infcodes.pas

@@ -155,8 +155,13 @@ begin
           if s.last then
           if s.last then
           begin
           begin
             t := c^.sub.code.tree;
             t := c^.sub.code.tree;
-            if t^.exop and 32 <> 0 then
-              break;
+            { update t (like as in following code), and check, if requested
+              bits are available }
+            Inc(t, cardinal(b) and inflate_mask[j]);
+            if k >= t^.bits then
+            { now, we can examine t^.exop value }
+              if t^.exop and 32 <> 0 then
+                break;
           end;
           end;
 
 
           exit;
           exit;