On Fri, 20 Feb 2026 20:03:07 GMT, Phil Race <[email protected]> wrote:
>> src/java.desktop/share/classes/java/awt/image/DataBuffer.java line 545:
>>
>>> 543:
>>> 544: void checkIndex(int i) {
>>> 545: if ((i + offset) >= size) {
>>
>> Is there ever a possibility for integer overflow? Should we care?
>
> I don't think it matters here.
This method and its usage seem suspicious, how should a negative index i be
handled, is it allowed?
Is the size actually "a size" of the array the buffer stored? It seems that it
is the number of items in the array:
Example: new DataBufferInt(new int[8], 5, 3)
How should the next be validated: i = 2, offset = 3, size = 5 ->> "(2+3) >= 5"
->> BOOM?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r2881512160