javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Image.java
branchRCL_3
changeset 77 7cee158cb8cd
parent 66 2455ef1f5bbc
child 83 26b2b12093af
equal deleted inserted replaced
71:d5e927d5853b 77:7cee158cb8cd
   323         }
   323         }
   324     }
   324     }
   325 
   325 
   326     public static Image createRGBImage(int[] aRgb, int aWidth, int aHeight, boolean aProcessAlpha)
   326     public static Image createRGBImage(int[] aRgb, int aWidth, int aHeight, boolean aProcessAlpha)
   327     {
   327     {
   328         if (aRgb.length < (aWidth * aHeight))
   328         if (aWidth <= 0 || aHeight <= 0)
       
   329         {
       
   330             throw new IllegalArgumentException();
       
   331         }
       
   332 
       
   333         if (aRgb.length < (aWidth * aHeight) || (aWidth * aHeight) < 0)
   329         {
   334         {
   330             throw new ArrayIndexOutOfBoundsException();
   335             throw new ArrayIndexOutOfBoundsException();
   331         }
   336         }
   332 
       
   333         if (aWidth <= 0 || aHeight <= 0)
       
   334         {
       
   335             throw new IllegalArgumentException();
       
   336         }
       
   337 
       
   338         try
   337         try
   339         {
   338         {
   340             return new Image(aRgb, aWidth, aHeight, aProcessAlpha);
   339             return new Image(aRgb, aWidth, aHeight, aProcessAlpha);
   341         }
   340         }
   342         catch (OutOfMemoryError oom)
   341         catch (OutOfMemoryError oom)