< prev index next >
src/java.desktop/share/classes/java/awt/image/SampleModel.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 124,134 ****
long size = (long)w * h;
if (w <= 0 || h <= 0) {
throw new IllegalArgumentException("Width ("+w+") and height ("+
h+") must be > 0");
}
! if (size >= Integer.MAX_VALUE) {
throw new IllegalArgumentException("Dimensions (width="+w+
" height="+h+") are too large");
}
if (dataType < DataBuffer.TYPE_BYTE ||
--- 124,134 ----
long size = (long)w * h;
if (w <= 0 || h <= 0) {
throw new IllegalArgumentException("Width ("+w+") and height ("+
h+") must be > 0");
}
! if (size > Integer.MAX_VALUE) {
throw new IllegalArgumentException("Dimensions (width="+w+
" height="+h+") are too large");
}
if (dataType < DataBuffer.TYPE_BYTE ||
< prev index next >