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
@@ -142,6 +142,7 @@ public class PNGImageReader extends ImageReader {
142142 static final int tRNS_TYPE = 0x74524e53 ;
143143 static final int zTXt_TYPE = 0x7a545874 ;
144144
145+ static final int MAX_INFLATED_TEXT_LENGTH = 262144 ;
145146 static final int PNG_COLOR_GRAY = 0 ;
146147 static final int PNG_COLOR_RGB = 2 ;
147148 static final int PNG_COLOR_PALETTE = 3 ;
@@ -670,7 +671,7 @@ private void parse_tRNS_chunk(int chunkLength) throws IOException {
670671 private static byte [] inflate (byte [] b ) throws IOException {
671672 InputStream bais = new ByteArrayInputStream (b );
672673 try (InputStream iis = new InflaterInputStream (bais )) {
673- return iis .readAllBytes ( );
674+ return iis .readNBytes ( MAX_INFLATED_TEXT_LENGTH );
674675 }
675676 }
676677
You can’t perform that action at this time.
0 commit comments