summary refs log tree commit diff
path: root/crypto/bzip2/src/CBZip2InputStream.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/bzip2/src/CBZip2InputStream.cs')
-rw-r--r--crypto/bzip2/src/CBZip2InputStream.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/bzip2/src/CBZip2InputStream.cs b/crypto/bzip2/src/CBZip2InputStream.cs
index f1d31a0ab..111b1b530 100644
--- a/crypto/bzip2/src/CBZip2InputStream.cs
+++ b/crypto/bzip2/src/CBZip2InputStream.cs
@@ -334,7 +334,6 @@ namespace Org.BouncyCastle.Apache.Bzip2
             int pp = 0, baseVal = 0;
             for (int i = minLen; i <= maxLen; i++)
             {
-                basev[i] = baseVal;
                 for (int j = 0; j < alphaSize; j++)
                 {
                     if (length[j] == i)
@@ -342,8 +341,9 @@ namespace Org.BouncyCastle.Apache.Bzip2
                         perm[pp++] = j;
                     }
                 }
+                basev[i] = baseVal;
                 limit[i] = baseVal + pp;
-                baseVal += limit[i];
+                baseVal += baseVal + pp;
             }
         }