RFR: 8274735: javax.imageio.IIOException: Unsupported Image Type while processing a valid JPEG image [v2]

Sergey Bylokhov serb at openjdk.java.net
Thu Mar 24 07:53:55 UTC 2022


On Thu, 24 Mar 2022 02:52:08 GMT, Phil Race <prr at openjdk.org> wrote:

>> src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java line 1740:
>> 
>>> 1738:         raster.setRect(sourceLine);
>>> 1739:         if (invertCMYK) {
>>> 1740:             byte[] data = ((DataBufferByte)raster.getDataBuffer()).getData();
>> 
>> Is it known that the type of the raster here is always DataBufferByte?
>
> yes

As far as I understand the in the read code we create a DataBufferByte so later we can use the cast. But in this method we do not create it, and use what the user provide to us, can the user "craft custom " raster/metadata and the cs type?

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

PR: https://git.openjdk.java.net/jdk/pull/7849



More information about the client-libs-dev mailing list