OSDN Git Service

Merged gcj-eclipse branch to trunk.
[pf3gnuchains/gcc-fork.git] / libjava / classpath / java / awt / image / Raster.java
index 160f8be..d63e156 100644 (file)
@@ -511,9 +511,10 @@ public class Raster
                             int height, int childMinX, int childMinY,
                             int[] bandList)
   {
-    /* FIXME: Throw RasterFormatException if child bounds extends
-       beyond the bounds of this raster. */
-
+    if (parentX < minX || parentX + width > minX + this.width
+        || parentY < minY || parentY + height > minY + this.height)
+      throw new RasterFormatException("Child raster extends beyond parent");
+    
     SampleModel sm = (bandList == null) ?
       sampleModel :
       sampleModel.createSubsetSampleModel(bandList);