throw exception if getAlpha returns very large value (that is too big for int) (#1000)

This commit is contained in:
PJ Fanning 2026-01-17 15:09:06 +01:00 committed by GitHub
parent 372388b7ed
commit 58ac8d05f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -230,6 +230,7 @@ public class HSLFPictureShape extends HSLFSimpleShape implements PictureShape<HS
} }
public int getAlpha() { public int getAlpha() {
return (int)(super.getAlpha(EscherPropertyTypes.FILL__FILLOPACITY)*100000.0); return Math.toIntExact(
(long) (super.getAlpha(EscherPropertyTypes.FILL__FILLOPACITY) * 100000));
} }
} }