From 7c8a57108e95de3fd0b59c95e6302b3e6b8990ca Mon Sep 17 00:00:00 2001 From: Duong Nguyen Date: Sat, 19 Jul 2025 11:31:38 -0700 Subject: [PATCH] Remove the problematic catch of OOM. (#647) --- src/main/java/org/xerial/snappy/SnappyInputStream.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/org/xerial/snappy/SnappyInputStream.java b/src/main/java/org/xerial/snappy/SnappyInputStream.java index 7ccce1d..d6ffcd4 100755 --- a/src/main/java/org/xerial/snappy/SnappyInputStream.java +++ b/src/main/java/org/xerial/snappy/SnappyInputStream.java @@ -448,12 +448,7 @@ public class SnappyInputStream // extend the compressed data buffer size if (compressed == null || chunkSize > compressed.length) { // chunkSize exceeds limit - try { - compressed = new byte[chunkSize]; - } - catch (java.lang.OutOfMemoryError e) { - throw new SnappyError(SnappyErrorCode.INVALID_CHUNK_SIZE, e.getMessage()); - } + compressed = new byte[chunkSize]; } readBytes = 0; while (readBytes < chunkSize) {