This is an automated email from the ASF dual-hosted git repository.

fanningpj pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 58ac8d05f0 throw exception if getAlpha returns very large value (that 
is too big for int) (#1000)
58ac8d05f0 is described below

commit 58ac8d05f0d731a64853b2abe1ea659875b6b053
Author: PJ Fanning <[email protected]>
AuthorDate: Sat Jan 17 15:09:06 2026 +0100

    throw exception if getAlpha returns very large value (that is too big for 
int) (#1000)
---
 .../src/main/java/org/apache/poi/hslf/usermodel/HSLFPictureShape.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFPictureShape.java
 
b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFPictureShape.java
index ac2f12bd2f..a311dbf40d 100644
--- 
a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFPictureShape.java
+++ 
b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFPictureShape.java
@@ -230,6 +230,7 @@ public class HSLFPictureShape extends HSLFSimpleShape 
implements PictureShape<HS
     }
 
     public int getAlpha() {
-        return 
(int)(super.getAlpha(EscherPropertyTypes.FILL__FILLOPACITY)*100000.0);
+        return Math.toIntExact(
+            (long) (super.getAlpha(EscherPropertyTypes.FILL__FILLOPACITY) * 
100000));
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to