Fix error w/ lossless crop & libjpeg v7 emulation

The JPEG_LIB_VERSION #ifdef in jtransform_adjust_parameters() was
incorrect, which caused a "Bogus virtual array access" error when
attempting to use the lossless crop feature.

Introduced in c04bd3cc97.

This also adds libjpeg v7 API/ABI emulation to the Travis CI tests.
This commit is contained in:
DRC
2017-01-19 17:50:59 -06:00
parent eb38b61bfe
commit 2252795571
3 changed files with 17 additions and 4 deletions

View File

@@ -23,6 +23,13 @@ matrix:
- os: linux
compiler: gcc
env: CONFIGURE_FLAGS="--with-12bit"
- os: linux
compiler: gcc
env: CONFIGURE_FLAGS="--with-jpeg7"
addons:
apt:
packages:
- nasm
- os: linux
compiler: gcc
env: CONFIGURE_FLAGS="--with-jpeg8"

View File

@@ -22,6 +22,12 @@ source/destination managers. Due to an oversight, the `jpeg_skip_scanlines()`
and `jpeg_crop_scanlines()` functions were not being included in jpeg7.dll when
libjpeg-turbo was built with `-DWITH_JPEG7=1` and `-DWITH_MEMSRCDST=1`.
6. Fixed "Bogus virtual array access" error that occurred when using the
lossless crop feature in jpegtran or the TurboJPEG API, if libjpeg-turbo was
built with libjpeg v7 API/ABI emulation. This was apparently a long-standing
bug that has existed since the introduction of libjpeg v7/v8 API/ABI emulation
in libjpeg-turbo v1.1.
1.5.1
=====

View File

@@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding.
* libjpeg-turbo Modifications:
* Copyright (C) 2010, D. R. Commander.
* Copyright (C) 2010, 2017, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -1384,7 +1384,7 @@ jtransform_adjust_parameters (j_decompress_ptr srcinfo,
/* Correct the destination's image dimensions as necessary
* for rotate/flip, resize, and crop operations.
*/
#if JPEG_LIB_VERSION >= 70
#if JPEG_LIB_VERSION >= 80
dstinfo->jpeg_width = info->output_width;
dstinfo->jpeg_height = info->output_height;
#endif
@@ -1395,14 +1395,14 @@ jtransform_adjust_parameters (j_decompress_ptr srcinfo,
case JXFORM_TRANSVERSE:
case JXFORM_ROT_90:
case JXFORM_ROT_270:
#if JPEG_LIB_VERSION < 70
#if JPEG_LIB_VERSION < 80
dstinfo->image_width = info->output_height;
dstinfo->image_height = info->output_width;
#endif
transpose_critical_parameters(dstinfo);
break;
default:
#if JPEG_LIB_VERSION < 70
#if JPEG_LIB_VERSION < 80
dstinfo->image_width = info->output_width;
dstinfo->image_height = info->output_height;
#endif