Repository navigation
Conversation
… IPTC input Malformed input made several parsers throw unchecked exceptions instead of ImagingException: a WBMP size whose row length times height overflows int (IllegalArgumentException), an empty PNG sCAL chunk (ArrayIndexOutOfBoundsException), an XPM file ending where a string is expected (NullPointerException), and an IPTC block ending inside a record header (ArrayIndexOutOfBoundsException). Compute the WBMP size in long and reject sizes above Integer.MAX_VALUE, reject an empty sCAL chunk, check the XPM token for null, and stop reading IPTC records when the record header does not fit, as for an unexpected tag marker. Assisted-By: Claude Code:claude-opus-5-5
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 IMAGING-396.
Malformed input made four parsers throw unchecked exceptions instead of
ImagingException:rowLength * heightoverflowedint(IllegalArgumentException). The size is now computed inlongand rejected aboveInteger.MAX_VALUE.ArrayIndexOutOfBoundsException). It is now rejected.NullPointerException). The token is now checked for null.ArrayIndexOutOfBoundsException). Reading stops there, as it already does for an unexpected tag marker.The new
MalformedInputTest(4 tests, small base64 inputs) fails 4/4 without the change and passes with it.mvn -B verify checkstyle:check pmd:checkpasses (1263 tests, 0 failures).This issue was found by an LLM-Enhanced Static Analysis Engine and verified manually. The patch and this description were prepared with AI assistance (Claude Code) and reviewed by me; the commit carries an
Assisted-By:trailer.