On Tue, 13 Oct 2026 11:52:46 GMT, Jayathirth D V <[email protected]> wrote:

>> Phil Race has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   8393551
>
> src/java.desktop/share/native/libjavajpeg/imageioJPEG.c line 728:
> 
>> 726: 
>> 727:         for (j = 0; j < 64; j++) {
>> 728:             quant_ptr->quantval[j] = (UINT16)qdataBody[j];
> 
> Converting the values from "int" to "unsigned short" can cause issues.
> 65536 can become 0 and then we clamp it to 1. We can just clamp directly 
> without using UINT16 cast.

The definition is
  UINT16 quantval[DCTSIZE2];    /* quantization step for each coefficient */

so the cast is reasonable and might even be required by some compiler.
And it wouldn't change that we need the extra checks.

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

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

Reply via email to