RFR: 8318951: Additional negative value check in JPEG decoding

Sergey Bylokhov serb at openjdk.org
Fri Oct 27 18:50:31 UTC 2023


On Fri, 27 Oct 2023 05:54:04 GMT, Jayathirth D V <jdv at openjdk.org> wrote:

> We skip jpeg data during decoding using imageio_skip_input_data() in both src/java.desktop/share/native/libjavajpeg/imageioJPEG.c and src/java.desktop/share/native/libjavajpeg/jpegdecoder.c
> 
> We update num_bytes with sb->remaining_skip in these functions and it can overflow. We need to add additional check for num_bytes here.
> 
> With updated code ran all awt and imageio tests in CI and it is green.

I am not sure in what case this bug can be reproduced, but if it possible to get overflow there in the real app then probably we should skip that bytes in a few steps using small data?

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

PR Comment: https://git.openjdk.org/jdk/pull/16390#issuecomment-1783360995


More information about the client-libs-dev mailing list