diff options
Diffstat (limited to 'libjava/classpath/java/awt/image/Raster.java')
-rw-r--r-- | libjava/classpath/java/awt/image/Raster.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libjava/classpath/java/awt/image/Raster.java b/libjava/classpath/java/awt/image/Raster.java index 160f8be8b51..d63e156f6ae 100644 --- a/libjava/classpath/java/awt/image/Raster.java +++ b/libjava/classpath/java/awt/image/Raster.java @@ -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); |