File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/java.desktop/share/classes/com/sun/imageio/plugins/png Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2000, 2021 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2000, 2025 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -139,6 +139,7 @@ public class PNGImageReader extends ImageReader {
139139 static final int tRNS_TYPE = 0x74524e53 ;
140140 static final int zTXt_TYPE = 0x7a545874 ;
141141
142+ static final int MAX_INFLATED_TEXT_LENGTH = 262144 ;
142143 static final int PNG_COLOR_GRAY = 0 ;
143144 static final int PNG_COLOR_RGB = 2 ;
144145 static final int PNG_COLOR_PALETTE = 3 ;
@@ -661,7 +662,7 @@ private void parse_tRNS_chunk(int chunkLength) throws IOException {
661662 private static byte [] inflate (byte [] b ) throws IOException {
662663 InputStream bais = new ByteArrayInputStream (b );
663664 try (InputStream iis = new InflaterInputStream (bais )) {
664- return iis .readAllBytes ( );
665+ return iis .readNBytes ( MAX_INFLATED_TEXT_LENGTH );
665666 }
666667 }
667668
You can’t perform that action at this time.
0 commit comments