reject unsupported bit depths in load_png - #9229
Open
soma0212 wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9229 +/- ##
==========================================
+ Coverage 70.13% 70.29% +0.16%
==========================================
Files 255 255
Lines 78895 78895
Branches 18865 18865
==========================================
+ Hits 55332 55460 +128
+ Misses 17866 17832 -34
+ Partials 5697 5603 -94 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
alexreinking
approved these changes
Jul 21, 2026
Member
|
@soma0212 — Can you please rebase on main? |
soma0212
force-pushed
the
png-bit-depth-bounds
branch
from
July 28, 2026 05:37
eb4d34b to
e882789
Compare
Contributor
Author
|
Rebased on main. Only conflict was with #9219, which added its test at the same spot in image_io.cpp; kept both tests. Re-ran the 1-bit repro under ASAN against the rebased header to be safe: still rejected cleanly, and 8/16-bit loads are unchanged. |
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.
load_png picks the row reader from bit depth without checking it is one the loader actually supports:
Reject bit depths other than 8 or 16 up front, which is what query_png() already advertises, so valid 8- and 16-bit files are unchanged. Added a regression test that writes a 1-bit PNG and checks the load returns false instead of running off the row.