On Mon, 23 Mar 2026 04:29:47 GMT, Jayathirth D V <[email protected]> wrote:

>> Phil Race has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   8377568
>
>> I've updated for all comments to date. I am going to propose a significant 
>> change (need first to implement and test) to make negative offsets illegal. 
>> Briefly, the reason for this is that I've looked into 
>> https://bugs.openjdk.org/browse/JDK-4308987 It was a bug reported against JAI
>> 
>> "I am using JAI 1.0.2 "
>> 
>> Exception in thread "main" java.lang.ExceptionInInitializerError: 
>> java.lang.IllegalArgumentException: Data offset(s) must be positive 
>> integer(s) at java.awt.image.DataBuffer.(Unknown Source) at 
>> java.awt.image.DataBufferByte.(Unknown Source) at 
>> javax.media.jai.LookupTableJAI.(LookupTableJAI.java:115)
>> 
>> I've managed to locate the source for JAI 1.0.2 and the relevant code looks 
>> like this public LookupTableJAI(byte[] data, int offset) { this.data = new 
>> DataBufferByte(data, data.length, -offset); }
>> 
>> And that's why negative was needed. Quite odd to my mind, whereas in JAI 
>> 1.1.2 it looks like this public LookupTableJAI(byte[] data, int offset) { 
>> this.initOffsets(1, offset); this.data = new DataBufferByte(data, 
>> data.length); }
>> 
>> So I don't think we need to worry any more about breaking JAI. And some of 
>> the difficult to explain and problematic to implement cases go away.
>> 
>> Thoughts ?
> 
> This looks fine and its better to avoid negative offsets.

@jayathirthrao @aivanov-jdk @mrserb please re-review. Also the CSR still needs 
to be reviewed.

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

PR Comment: https://git.openjdk.org/jdk/pull/29766#issuecomment-4157154269

Reply via email to