On Tue, 27 Jan 2026 19:04:04 GMT, Phil Race <[email protected]> wrote:

> We specify that scanlineStride < 0 will throw IAE, but it was not checked up 
> front in all cases, so sometimes would be IAE and sometimes 
> NegativeArrayIndexException.
> Add an explicit check.

src/java.desktop/share/classes/java/awt/image/Raster.java line 458:

> 456:             throw new IllegalArgumentException("Scanline stride must be 
> >= 0");
> 457:         }
> 458:         if (bankIndices == null) {

The JDK-8369129 changed some checks from "scanlineStride < 0" to 
"scanlineStride <= 0". Should not we do the same here?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29454#discussion_r2738201423

Reply via email to