Merge branch 'GP-7131_ryanmkurtz_PR-9452_kaibolay_reasonable-png-chunk-size'

This commit is contained in:
Ryan Kurtz
2026-08-10 12:44:33 -04:00
@@ -40,6 +40,9 @@ public class PNGChunk implements StructConverter {
*/
public PNGChunk(BinaryReader reader) throws IOException {
length = reader.readNextInt();
if (length < 0 || length > 8 * 1024 * 1024) {
throw new IllegalArgumentException("Unreasonable PNG chunk length: " + length);
}
chunkID = reader.readNextInt();
data = reader.readNextByteArray(length);
crc32 = reader.readNextInt();