On 07/08/2016 04:08 AM, Jayathirth D V wrote:

Hi,

In JDK-8152672 <https://bugs.openjdk.java.net/browse/JDK-8152672> we modified skipImage() in JpegImageReader.java and added tighter checks for parsing Jpeg data.

We have to find any marker,0 or EOF after we find "FF" while parsing JPEG data.

But in JDK-8160943 <https://bugs.openjdk.java.net/browse/JDK-8160943> we have gap between APP0 marker and DQT(FF DB) marker which contains data "00 FF".

APP0_End -> 00 FF -> FF DB(DQT)

So after we skip APP0 marker we find two bytes of data which is "FF FF". In the present code we consider this as invalid marker.


See https://www.w3.org/Graphics/JPEG/itu-t81.pdf

B.1.1.2 Markers
Markers serve to identify the various structural parts of the compressed data formats.
Most markers start marker segments containing a related group of parameters;
some markers stand alone. All markers are assigned two-byte codes: an
X'FF' byte followed by a byte which is not equal to 0 or X'FF' (see Table B.1).
Any marker may optionally be preceded by any number of fill bytes,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
which are bytes assigned code X'FF
^^^^^^^^^^^^^^^^^^^^^^

-phil.

Because of this JDK-8160943 <https://bugs.openjdk.java.net/browse/JDK-8160943> is failing.

Is the length of APP0 marker not valid in the image or we should not consider "FF FF" as invalid maker?

Please let me know your input.

Thanks,

Jay


Reply via email to