Marti2203 opened a new pull request, #577: URL: https://github.com/apache/commons-imaging/pull/577
Fixes [IMAGING-395](https://issues.apache.org/jira/browse/IMAGING-395). `ColorSpaceSubset.setAverageRgb()` computed `count * (component << 8 - precision)` in `int` before adding it to the `long` sums, so a subset of more than about 8.4 million bright pixels (for example a 3000x3000 white image) got a wrapped average color, 0x1F1F1F instead of near-white. This multiplies in `long`. `ColorSpaceSubsetTest.testSetAverageRgbLargeCount` fails without the change (0x131313) and passes with it; the palette 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]
