FreeImage JXR loading broken due to leaking define

Bug #1849929 reported by Fabian Wiesel
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
freeimage (Ubuntu)
New
Undecided
Unassigned

Bug Description

1) Ubuntu 18.04.3 LTS
2) libfreeimage-dev=3.17.0+ds1-5build2, libjxr-dev=1.1-6build1
3) Loading a Jpeg XR file over the api should work, as it is reported as supported.
4) It fails with "unsupported format", because the conversion fails in the libfreeimage library, while the target image is not defined.

In essence, the JXR loading functionality is broken.

In FreeImage.h:132 _WINDOWS_ is defined, leaking over to any other include file.

Injxrlib/guiddef.h:45, the field Data1 is "unsigned long" for windows and 32-bit systems, as the windows abi defaults to 32-bit "unsigned int", while it should be 32-bit.
By becoming 64-bit, the GUID is now 4 bytes longer, which are filled then with "random" data.

Undefining "_WINDOWS_" before including "JXRGlue.h" in PluginJXR.cpp should fix the behaviour.
Better would probably to not leak the definition in the first place, but that seems a more involved task.

Find enclosed the code to attempt to load a jpeg-xr, once directly with jxr, and then with the freeimage library.

Tags: patch
Revision history for this message
Fabian Wiesel (fwiesel) wrote :
Revision history for this message
Fabian Wiesel (fwiesel) wrote :

Discovered the upstream bug-report: https://sourceforge.net/p/freeimage/bugs/294/

Revision history for this message
Fabian Wiesel (fwiesel) wrote :

Attached a patch, which applies after all previous patches in the debian package.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Fix-PluginJXR.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Fabian Wiesel (fwiesel)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.