Repository navigation
Conversation
Member
|
Closing as a duplicate of PR #923. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #489.
The simplified write path computes
0xffffffffU / png_row_strideinpng_image_write_main(). Withimage.width == 0,png_row_strideis zero, so UBSan reports a division-by-zero before invalid dimensions are rejected.This implements the maintainer-proposed fix in #489: reject zero width/height in
png_image_write_init()before creating the write structures.Validation against current
libpng18base964b4135949703b705fc760fc3fb546b86e5ab47:-fsanitize=address,undefined):0x1and1x0fail cleanly; a1x1control succeeds; no ASan/UBSan diagnostic was observed.pngtestonpngbar.png:PASS (323 zero samples)andlibpng passes test.The change is intentionally local to simplified write initialization.
AI assistance disclosure: this patch and validation were prepared with AI assistance and reviewed against the current source and observed sanitizer/test results.