This is an automated email from the ASF dual-hosted git repository.

garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git

commit 4095ce1396709d62a8e49d72811f327b87a29506
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Jul 10 09:32:23 2026 -0400

    Don't allocate array before illegal value detection.
---
 .../java/org/apache/commons/compress/harmony/unpack200/BandSet.java    | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/compress/harmony/unpack200/BandSet.java 
b/src/main/java/org/apache/commons/compress/harmony/unpack200/BandSet.java
index 1c5552529..aa75dbf00 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/BandSet.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/BandSet.java
@@ -550,7 +550,6 @@ public long[][] parseFlags(final String name, final 
InputStream in, final int[]
             return new long[][] { {} };
         }
         int sum = 0;
-        final long[][] result = new long[count][];
         for (int i = 0; i < count; i++) {
             if (counts[i] < 0) {
                 throw new Pack200Exception("count < 0");
@@ -563,8 +562,8 @@ public long[][] parseFlags(final String name, final 
InputStream in, final int[]
             hi = decodeBandInt(name, in, hiCodec, sum);
         }
         lo = decodeBandInt(name, in, loCodec, sum);
-
         int index = 0;
+        final long[][] result = new long[count][];
         for (int i = 0; i < count; i++) {
             result[i] = new long[counts[i]];
             for (int j = 0; j < result[i].length; j++) {

Reply via email to