[Bug 265663] java/openjdk17: problem with jpeg-turbo?

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 05 Aug 2022 18:26:10 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265663

            Bug ID: 265663
           Summary: java/openjdk17: problem with jpeg-turbo?
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: java@FreeBSD.org
          Reporter: dennis.noordsij@alumni.helsinki.fi
          Assignee: java@FreeBSD.org
             Flags: maintainer-feedback?(java@FreeBSD.org)

Created attachment 235708
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=235708&action=edit
Example jpeg that demonstrates the issue

I recently upgraded from openjdk-8 to openjdk-17, and noticed that JPEG files
that were previously opening succesfully were now failing with:

```
Exception in thread "main" javax.imageio.IIOException: Bogus virtual array
access
        at
java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native
Method)
        at
java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown
Source)
        at
java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source)
        at java.desktop/javax.imageio.ImageIO.read(Unknown Source)
        at java.desktop/javax.imageio.ImageIO.read(Unknown Source)
        at ImageExceptionMain.main(ImageExceptionMain.java:10)

```

I could reproduce this as well on the default Arch Linux openjdk17, and could
reproduce it as well on openjdk 11.

Both appear to use the system libjpeg (jpeg-turbo) instead of the bundled one.
If I change the port Makefile and remove:
```
    --with-libjpeg=system
```
, (implying `--with-libjpeg=bundled`), then everything works.

I could not find a jpeg-turbo binary that shows a problem, nor get any other
image program to complain about the (attached) file and suggest it is somehow
invalid.

I have attached a source file and image file (no affiliation to whatever it is
saying) to reproduce this issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.