File tree 1 file changed +3
-2
lines changed
src/java.desktop/share/classes/com/sun/imageio/plugins/png
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
1
/*
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.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -142,6 +142,7 @@ public class PNGImageReader extends ImageReader {
142
142
static final int tRNS_TYPE = 0x74524e53 ;
143
143
static final int zTXt_TYPE = 0x7a545874 ;
144
144
145
+ static final int MAX_INFLATED_TEXT_LENGTH = 262144 ;
145
146
static final int PNG_COLOR_GRAY = 0 ;
146
147
static final int PNG_COLOR_RGB = 2 ;
147
148
static final int PNG_COLOR_PALETTE = 3 ;
@@ -670,7 +671,7 @@ private void parse_tRNS_chunk(int chunkLength) throws IOException {
670
671
private static byte [] inflate (byte [] b ) throws IOException {
671
672
InputStream bais = new ByteArrayInputStream (b );
672
673
try (InputStream iis = new InflaterInputStream (bais )) {
673
- return iis .readAllBytes ( );
674
+ return iis .readNBytes ( MAX_INFLATED_TEXT_LENGTH );
674
675
}
675
676
}
676
677
You can’t perform that action at this time.
0 commit comments