On Tue, 27 Oct 2026 20:56:14 GMT, Sergey Bylokhov <[email protected]> wrote:

>> I changed the description to say "8 bit samples" 
>> 
>> Do you have a test that shows this crash ? 
>> 
>> I experimented just now with only clamping the < 1 .. but of course my new 
>> test fails with that because the *existing* behaviour of the plugin is to 
>> throw an Exception when reading a JPEG with 16-bit quantization data.
>> 
>> And by not clamping on write, that's what is there to be read.
>> 
>> I could make it do the < 1 clamp on read AND write, but only do the 255 
>> clamp on write.
>> 
>> 
>> -            if (q > 255) { // ImageIO supports baseline only
>> +            if ((q > 255) && !cinfo->is_decompressor) { // ImageIO supports 
>> 8 bit samples only
>>                  q = 255;
>>              }
>> 
>> 
>> in which case the test would pass.
>
> I was distracted by some urgent releases, but I’ll take a look at this PR 
> soon.

Is this comment 

> ImageIO supports baseline only

accurate? since this file also has code for progressive JPEG so I guess it is 
supported
I believe your suggestion to change "// ImageIO supports 8 bit samples only" is 
more advisable..

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33217#discussion_r4690324116

Reply via email to