GetLegendGraphic in JPEG will fail if libjpeg-turbo is installed

Description

Trying to get a JPEG legend with the libjpeg-turbo enabled will produce the following error:

Example:
http://localhost:8080/geoserver/ows?service=WMS&request=GetLegendGraphic&format=image%2Fjpeg&height=12&width=12&layer=nurc%3Amosaic&style=&version=1.3.0&SLD_VERSION=1.1.0&LEGEND_OPTIONS=forceLabels%3Aon%3BfontSize%3A10&SCALE=9244667

And this stack trace is logged:

I tested this with libjpeg-turbo version 1.5.3, 2.0.0 and 2.0.1

I also tried to test the latest 2.16.x but I got a different error that prevents any legend to appear, even without the libjpeg-turbo library and plugin installed.

Environment

GeoServer 2.14.1 with LibJPEG-turbo plugin
Tested with LibJPEG-turbo 1.5.3, 2.0.0 and 2.0.2
Windows and Linux

Status

Assignee

Andrea Aime

Reporter

Gnafu

Triage

None

Fix versions

Affects versions

Priority

Medium
Configure