On Mon, 8 Jul 2024 13:39:49 GMT, Ambarish Rapte <ara...@openjdk.org> wrote:
> The parameter "offset" is not validated in the 2 native methods getRGBImpl() > and setRGBImpl() of com.sun.pisces.AbstractSurface (in JAbstractSurface.c). > The PR adds the "offset < 0" check to both the methods. modules/javafx.graphics/src/main/native-prism-sw/JAbstractSurface.c line 88: > 86: width < 0 || width > (surfaceWidth - x) || > 87: height < 0 || height > (surfaceHeight - y) || > 88: scanLength < width || offset < 0) { this might be a naive question: would it make more sense to fail earlier, i.e. to test the offset before getting the surface pointer? ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1497#discussion_r1668900214