Marti2203 opened a new pull request, #572: URL: https://github.com/apache/commons-imaging/pull/572
Fixes [IMAGING-390](https://issues.apache.org/jira/browse/IMAGING-390). `ZlibDeflate.decompress()` (Deflate-compressed TIFF strips and tiles) called `Inflater.inflate(result)` once and returned `result` regardless of how many bytes were inflated, so truncated data decoded silently with a zero-filled tail. This inflates until the expected size is reached and throws an `ImagingException` when the data ends or runs out first, as `PackBits` does for the same case ("Unpack bits source exhausted"). It also calls `Inflater.end()`. New `ZlibDeflateTest`: a round trip, and a truncated stream, which fails without the change. The full test suite (1259 tests) and `mvn -B -DskipTests -DskipITs` pass. 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. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
