--- p7zip_16.02/CPP/7zip/Compress/ShrinkDecoder.cpp.orig
+++ p7zip_16.02/CPP/7zip/Compress/ShrinkDecoder.cpp
@@ -121,7 +121,12 @@
     {
       _stack[i++] = _suffixes[cur];
       cur = _parents[cur];
-    }
+      if (i >= kNumItems)
+        break;
+     }
+
+    if (i >= kNumItems)
+      break;
     
     _stack[i++] = (Byte)cur;
     lastChar2 = (Byte)cur;
