From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:PNG" |
|---|
| claim | "A PNG chunk is a big-endian u32 data length (0 to 2^31-1), a 4-byte ASCII type, the data, and a big-endian CRC-32 computed over the type and the data but not the length; so a chunk is 12 bytes plus its data." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:PNG" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "png_chunk" |
|---|
| size_min | 12 |
|---|
| fields | | offset | 0 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "length" |
|---|
| notes | "big-endian; data length only, at most 0x7FFFFFFF" |
|---|
|
| offset | 4 |
|---|
| size | 4 |
|---|
| type | "char[4]" |
|---|
| name | "type" |
|---|
| notes | "e.g. IHDR; bit 5 of each byte is a property flag" |
|---|
|
| offset | 8 |
|---|
| size | 0 |
|---|
| type | "uint8_t[]" |
|---|
| name | "data" |
|---|
| notes | "length bytes, then a big-endian uint32 CRC-32 (zlib crc32) of type + data at offset 8 + length" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "documentation" |
|---|
| detail | "https://www.w3.org/TR/png-3/ section 5.3 Chunk layout" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "pngdump verified every chunk CRC of 166 test images; the crashers huge_*.png use length 0x3FFFFFFF past the end of the file" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Chunk" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T08:50:44.172Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-17T08:51:35.538Z" |
|---|
| summary | "Use C types; drop the CRC field that overlapped data at offset 8 in the exported header (its position, 8 + length, is in the data field's notes and the claim)" |
|---|
| changed | |
|---|
|
|
|---|