Skip to content

Handle eof and missing ihdr in png decoder#1718

Merged
SimonCropp merged 3 commits intomainfrom
Handle-EOF-and-missing-IHDR-in-PNG-decoder
Apr 16, 2026
Merged

Handle eof and missing ihdr in png decoder#1718
SimonCropp merged 3 commits intomainfrom
Handle-EOF-and-missing-IHDR-in-PNG-decoder

Conversation

@SimonCropp
Copy link
Copy Markdown
Member

No description provided.

Replace ReadExact with ReadAtLeast to detect EOF and break out of the chunk loop cleanly for truncated/streaming inputs. Stop processing if a chunk length is too large (break instead of throwing). Add an explicit check that IHDR was seen and throw if missing. Rewind idat.Position before calling Reconstruct so the IDAT stream is read from the start.
@SimonCropp SimonCropp added this to the 31.16.1 milestone Apr 16, 2026
@SimonCropp SimonCropp merged commit bcab5fd into main Apr 16, 2026
4 of 6 checks passed
@SimonCropp SimonCropp deleted the Handle-EOF-and-missing-IHDR-in-PNG-decoder branch April 16, 2026 07:30
This was referenced Apr 16, 2026
This was referenced Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant