jmestwa-coder commented on code in PR #1053:
URL: https://github.com/apache/poi/pull/1053#discussion_r3178285103
##########
poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/WMF.java:
##########
@@ -90,7 +90,8 @@ protected byte[] formatImageForSlideshow(byte[] data) {
header.setZipSize(compressed.length);
byte[] checksum = getChecksum(data);
- byte[] rawData = new byte[checksum.length * getUIDInstanceCount() +
header.getSize() + compressed.length];
+ long size = (long)checksum.length * getUIDInstanceCount() +
header.getSize() + compressed.length;
Review Comment:
I updated the calculations to use Math.addExact for clearer, overflow-safe
logic and kept the change minimal without adding a new helper. I also updated
the test to cover the actual calculation path and verify the overflow behaviour.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]