You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2018/01/08 10:06:38 UTC

commons-compress git commit: COMPRESS-380 make second part of assumption explicit

Repository: commons-compress
Updated Branches:
  refs/heads/COMPRESS-380 3600a5f51 -> 19ad28711


COMPRESS-380 make second part of assumption explicit


Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/19ad2871
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/19ad2871
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/19ad2871

Branch: refs/heads/COMPRESS-380
Commit: 19ad28711cd7f0b5e2d8a5fab73b978fdb057882
Parents: 3600a5f
Author: Stefan Bodewig <bo...@apache.org>
Authored: Mon Jan 8 09:15:24 2018 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Mon Jan 8 09:15:24 2018 +0100

----------------------------------------------------------------------
 .../commons/compress/compressors/deflate64/HuffmanDecoder.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/19ad2871/src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoder.java b/src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoder.java
index 8b006c3..f1f1042 100644
--- a/src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoder.java
+++ b/src/main/java/org/apache/commons/compress/compressors/deflate64/HuffmanDecoder.java
@@ -197,7 +197,7 @@ class HuffmanDecoder implements Closeable {
 
         @Override
         int read(byte[] b, int off, int len) throws IOException {
-            // as len is an int the min must fit into an int as well
+            // as len is an int and (blockLength - read) is >= 0 the min must fit into an int as well
             int max = (int) Math.min(blockLength - read, len);
             for (int i = 0; i < max; i++) {
                 byte next = (byte) (readBits(Byte.SIZE) & 0xFF);