tj3Set(): Allow TJPARAM_LOSSLESSPT vals from 0..15

The target data precision isn't known at the time that the calling
program sets TJPARAM_LOSSLESSPT, so tj3Set() needs to allow all possible
values (from 0 to 15.)  jpeg_enable_lossless(), which is called within
the body of tj3Compress*(), will throw an error if the point transform
value is greater than {data precision} - 1.
This commit is contained in:
DRC
2024-09-23 13:22:09 -04:00
parent 7f200a2acc
commit 63f4cf4222
3 changed files with 13 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ if(CMAKE_EXECUTABLE_SUFFIX)
endif()
project(libjpeg-turbo C)
set(VERSION 3.0.4)
set(VERSION 3.0.5)
set(COPYRIGHT_YEAR "1991-2024")
string(REPLACE "." ";" VERSION_TRIPLET ${VERSION})
list(GET VERSION_TRIPLET 0 VERSION_MAJOR)

View File

@@ -1,3 +1,14 @@
3.0.5
=====
### Significant changes relative to 3.0.4:
1. Fixed an issue in the TurboJPEG API whereby, when generating a
12-bit-per-sample or 16-bit-per-sample lossless JPEG image, specifying a point
transform value greater than 7 resulted in an error ("Parameter value out of
range".)
3.0.4
=====

View File

@@ -751,7 +751,7 @@ DLLEXPORT int tj3Set(tjhandle handle, int param, int value)
case TJPARAM_LOSSLESSPT:
if (!(this->init & COMPRESS))
THROW("TJPARAM_LOSSLESSPT is read-only in decompression instances.");
SET_PARAM(losslessPt, 0, this->precision - 1);
SET_PARAM(losslessPt, 0, 15);
break;
case TJPARAM_RESTARTBLOCKS:
if (!(this->init & COMPRESS))