javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Image.java
branchRCL_3
changeset 77 7cee158cb8cd
parent 66 2455ef1f5bbc
child 83 26b2b12093af
--- a/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Image.java	Tue Sep 14 21:06:50 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Image.java	Wed Sep 15 12:05:25 2010 +0300
@@ -325,16 +325,15 @@
 
     public static Image createRGBImage(int[] aRgb, int aWidth, int aHeight, boolean aProcessAlpha)
     {
-        if (aRgb.length < (aWidth * aHeight))
-        {
-            throw new ArrayIndexOutOfBoundsException();
-        }
-
         if (aWidth <= 0 || aHeight <= 0)
         {
             throw new IllegalArgumentException();
         }
 
+        if (aRgb.length < (aWidth * aHeight) || (aWidth * aHeight) < 0)
+        {
+            throw new ArrayIndexOutOfBoundsException();
+        }
         try
         {
             return new Image(aRgb, aWidth, aHeight, aProcessAlpha);