This is an automated email from the ASF dual-hosted git repository.
lkishalmi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new d39ef4f [NETBEANS-4420] Fix IAE on tooltip images with unknown size.
d39ef4f is described below
commit d39ef4f3a1b9bf8ed6d1e9bb326e8bf4d9c765d8
Author: Laszlo Kishalmi <[email protected]>
AuthorDate: Wed Jul 1 21:04:48 2020 -0700
[NETBEANS-4420] Fix IAE on tooltip images with unknown size.
---
platform/openide.util.ui/src/org/openide/util/ImageUtilities.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
index 5a24b70..d9d613c 100644
--- a/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
+++ b/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java
@@ -811,8 +811,8 @@ public final class ImageUtilities {
ensureLoaded(image1);
ensureLoaded(image2);
- int w = Math.max(image1.getWidth(null), x + image2.getWidth(null));
- int h = Math.max(image1.getHeight(null), y + image2.getHeight(null));
+ int w = Math.max(1, Math.max(image1.getWidth(null), x +
image2.getWidth(null)));
+ int h = Math.max(1, Math.max(image1.getHeight(null), y +
image2.getHeight(null)));
boolean bitmask = (image1 instanceof Transparency) &&
((Transparency)image1).getTransparency() != Transparency.TRANSLUCENT
&& (image2 instanceof Transparency) &&
((Transparency)image2).getTransparency() != Transparency.TRANSLUCENT;
@@ -1064,8 +1064,8 @@ public final class ImageUtilities {
ImageUtilities.ensureLoaded(image);
boolean bitmask = (image instanceof Transparency) &&
((Transparency) image).getTransparency() != Transparency.TRANSLUCENT;
ColorModel model = colorModel(bitmask ? Transparency.BITMASK :
Transparency.TRANSLUCENT);
- int w = image.getWidth(null);
- int h = image.getHeight(null);
+ int w = Math.max(1, image.getWidth(null));
+ int h = Math.max(1, image.getHeight(null));
if (url == null) {
Object value = image.getProperty("url", null);
url = (value instanceof URL) ? (URL) value : null;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists