You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by lk...@apache.org on 2020/07/07 15:18:37 UTC

[netbeans] branch release120 updated: [NETBEANS-4420] Fix IAE on tooltip images with unknown size.

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

lkishalmi pushed a commit to branch release120
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/release120 by this push:
     new 802e926  [NETBEANS-4420] Fix IAE on tooltip images with unknown size.
802e926 is described below

commit 802e9264462e4dd346d2af254f64862675028e81
Author: Laszlo Kishalmi <la...@gmail.com>
AuthorDate: Wed Jul 1 21:04:48 2020 -0700

    [NETBEANS-4420] Fix IAE on tooltip images with unknown size.
---
 platform/openide.util.ui/manifest.mf                              | 2 +-
 platform/openide.util.ui/src/org/openide/util/ImageUtilities.java | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/platform/openide.util.ui/manifest.mf b/platform/openide.util.ui/manifest.mf
index fd9ee98..0f3a393 100644
--- a/platform/openide.util.ui/manifest.mf
+++ b/platform/openide.util.ui/manifest.mf
@@ -1,5 +1,5 @@
 Manifest-Version: 1.0
 OpenIDE-Module: org.openide.util.ui
 OpenIDE-Module-Localizing-Bundle: org/openide/util/Bundle.properties
-OpenIDE-Module-Specification-Version: 9.16
+OpenIDE-Module-Specification-Version: 9.16.1
 
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: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists