Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libjpeg-turbo for openSUSE:Factory 
checked in at 2022-08-19 17:53:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libjpeg-turbo (Old)
 and      /work/SRC/openSUSE:Factory/.libjpeg-turbo.new.2083 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libjpeg-turbo"

Fri Aug 19 17:53:33 2022 rev:64 rq:997984 version:unknown

Changes:
--------
--- /work/SRC/openSUSE:Factory/libjpeg-turbo/libjpeg-turbo.changes      
2022-07-07 12:56:32.747250161 +0200
+++ /work/SRC/openSUSE:Factory/.libjpeg-turbo.new.2083/libjpeg-turbo.changes    
2022-08-19 17:54:44.191881313 +0200
@@ -1,0 +2,34 @@
+Mon Aug 15 18:07:30 UTC 2022 - Tom Mbrt <tom.m...@googlemail.com>
+
+- update to 2.1.4:
+  * Fixed a regression introduced in 2.1.3 that caused build failures with
+    Visual Studio 2010.
+
+  * The tjDecompressHeader3() function in the TurboJPEG C API and the
+    TJDecompressor.setSourceImage() method in the TurboJPEG Java API now
+    accept "abbreviated table specification" (AKA "tables-only") datastreams,
+    which can be used to prime the decompressor with quantization and Huffman
+    tables that can be used when decompressing subsequent "abbreviated image"
+    datastreams.
+
+  * libjpeg-turbo now performs run-time detection of AltiVec instructions on
+    OS X/PowerPC systems if AltiVec instructions are not enabled at compile
+    time. This allows both AltiVec-equipped (PowerPC G4 and G5) and
+    non-AltiVec-equipped (PowerPC G3) CPUs to be supported using the same
+    build of libjpeg-turbo.
+
+  * Fixed an error ("Bogus virtual array access") that occurred when
+    attempting to decompress a progressive JPEG image with a height less than
+    or equal to one iMCU (8 * the vertical sampling factor) using
+    buffered-image mode with interblock smoothing enabled. This was a
+    regression introduced by 2.1 beta1[6(b)].
+
+  * Fixed two issues that prevented partial image decompression from working
+    properly with buffered-image mode:
+      * Attempting to call jpeg_crop_scanline() after jpeg_start_decompress()
+        but before jpeg_start_output() resulted in an error ("Improper call to
+        JPEG library in state 207".)
+      * Attempting to use jpeg_skip_scanlines() resulted in an error ("Bogus
+        virtual array access") under certain circumstances.
+
+-------------------------------------------------------------------

Old:
----
  libjpeg-turbo-2.1.3.tar.gz
  libjpeg-turbo-2.1.3.tar.gz.sig

New:
----
  libjpeg-turbo-2.1.4.tar.gz
  libjpeg-turbo-2.1.4.tar.gz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libjpeg-turbo.spec ++++++
--- /var/tmp/diff_new_pack.rnLSmx/_old  2022-08-19 17:54:46.071885253 +0200
+++ /var/tmp/diff_new_pack.rnLSmx/_new  2022-08-19 17:54:46.075885262 +0200
@@ -27,7 +27,7 @@
 %define tmicro   0
 %define tlibver  %{tmajor}.%{tminor}.%{tmicro}
 Name:           libjpeg-turbo
-Version:        2.1.3
+Version:        2.1.4
 Release:        0
 Summary:        A SIMD-accelerated library for manipulating JPEG image files
 License:        BSD-3-Clause

++++++ libjpeg62-turbo.spec ++++++
--- /var/tmp/diff_new_pack.rnLSmx/_old  2022-08-19 17:54:46.103885321 +0200
+++ /var/tmp/diff_new_pack.rnLSmx/_new  2022-08-19 17:54:46.107885329 +0200
@@ -20,7 +20,7 @@
 %define minor   3
 %define micro   0
 %define libver  %{major}.%{minor}.%{micro}
-%define srcver  2.1.3
+%define srcver  2.1.4
 Name:           libjpeg62-turbo
 Version:        %{srcver}
 Release:        0

++++++ libjpeg-turbo-2.1.3.tar.gz -> libjpeg-turbo-2.1.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/BUILDING.md 
new/libjpeg-turbo-2.1.4/BUILDING.md
--- old/libjpeg-turbo-2.1.3/BUILDING.md 2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/BUILDING.md 2022-08-08 23:03:55.000000000 +0200
@@ -26,8 +26,8 @@
     slashes rather than backslashes in the path (for example,
     **c:/nasm/nasm.exe**).
   * NASM and Yasm are located in the CRB (Code Ready Builder) repository on
-    Red Hat Enterprise Linux 8 and in the PowerTools repository on CentOS 8,
-    which is not enabled by default.
+    Red Hat Enterprise Linux 8 and in the PowerTools repository on RHEL
+    derivatives, which is not enabled by default.
 
 ### Un*x Platforms (including Linux, Mac, FreeBSD, Solaris, and Cygwin)
 
@@ -79,6 +79,14 @@
   * If using JDK 11 or later, CMake 3.10.x or later must also be used.
 
 
+Sub-Project Builds
+------------------
+
+The libjpeg-turbo build system does not support being included as a sub-project
+using the CMake `add_subdirectory()` function.  Use the CMake
+`ExternalProject_Add()` function instead.
+
+
 Out-of-Tree Builds
 ------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/CMakeLists.txt 
new/libjpeg-turbo-2.1.4/CMakeLists.txt
--- old/libjpeg-turbo-2.1.3/CMakeLists.txt      2022-02-25 19:53:05.000000000 
+0100
+++ new/libjpeg-turbo-2.1.4/CMakeLists.txt      2022-08-08 23:03:55.000000000 
+0200
@@ -10,7 +10,7 @@
 endif()
 
 project(libjpeg-turbo C)
-set(VERSION 2.1.3)
+set(VERSION 2.1.4)
 set(COPYRIGHT_YEAR "1991-2022")
 string(REPLACE "." ";" VERSION_TRIPLET ${VERSION})
 list(GET VERSION_TRIPLET 0 VERSION_MAJOR)
@@ -909,10 +909,8 @@
     set(DEFAULT_FLOATTEST sse)
   elseif(CPU_TYPE STREQUAL "x86_64")
     set(DEFAULT_FLOATTEST no-fp-contract)
-  elseif(CPU_TYPE STREQUAL "i386" AND MSVC)
-    set(DEFAULT_FLOATTEST msvc)
   # else we can't really set an intelligent default for i386.  The appropriate
-  # value could be 387, no-fp-contract, or fp-contract, depending on the
+  # value could be no-fp-contract, fp-contract, 387, or msvc, depending on the
   # compiler and compiler options.  We leave it to the user to set FLOATTEST
   # manually.
   endif()
@@ -1503,8 +1501,11 @@
     DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 endif()
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/libjpeg.pc
-  ${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/libturbojpeg.pc
   DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+if(WITH_TURBOJPEG)
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/libturbojpeg.pc
+    DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+endif()
 install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/${CMAKE_PROJECT_NAME}Config.cmake
   
${CMAKE_CURRENT_BINARY_DIR}/pkgscripts/${CMAKE_PROJECT_NAME}ConfigVersion.cmake
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/ChangeLog.md 
new/libjpeg-turbo-2.1.4/ChangeLog.md
--- old/libjpeg-turbo-2.1.3/ChangeLog.md        2022-02-25 19:53:05.000000000 
+0100
+++ new/libjpeg-turbo-2.1.4/ChangeLog.md        2022-08-08 23:03:55.000000000 
+0200
@@ -1,3 +1,38 @@
+2.1.4
+=====
+
+### Significant changes relative to 2.1.3
+
+1. Fixed a regression introduced in 2.1.3 that caused build failures with
+Visual Studio 2010.
+
+2. The `tjDecompressHeader3()` function in the TurboJPEG C API and the
+`TJDecompressor.setSourceImage()` method in the TurboJPEG Java API now accept
+"abbreviated table specification" (AKA "tables-only") datastreams, which can be
+used to prime the decompressor with quantization and Huffman tables that can be
+used when decompressing subsequent "abbreviated image" datastreams.
+
+3. libjpeg-turbo now performs run-time detection of AltiVec instructions on
+OS X/PowerPC systems if AltiVec instructions are not enabled at compile time.
+This allows both AltiVec-equipped (PowerPC G4 and G5) and non-AltiVec-equipped
+(PowerPC G3) CPUs to be supported using the same build of libjpeg-turbo.
+
+4. Fixed an error ("Bogus virtual array access") that occurred when attempting
+to decompress a progressive JPEG image with a height less than or equal to one
+iMCU (8 * the vertical sampling factor) using buffered-image mode with
+interblock smoothing enabled.  This was a regression introduced by
+2.1 beta1[6(b)].
+
+5. Fixed two issues that prevented partial image decompression from working
+properly with buffered-image mode:
+
+     - Attempting to call `jpeg_crop_scanline()` after
+`jpeg_start_decompress()` but before `jpeg_start_output()` resulted in an error
+("Improper call to JPEG library in state 207".)
+     - Attempting to use `jpeg_skip_scanlines()` resulted in an error ("Bogus
+virtual array access") under certain circumstances.
+
+
 2.1.3
 =====
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/cjpeg.c 
new/libjpeg-turbo-2.1.4/cjpeg.c
--- old/libjpeg-turbo-2.1.3/cjpeg.c     2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/cjpeg.c     2022-08-08 23:03:55.000000000 +0200
@@ -38,16 +38,6 @@
 #include "jversion.h"           /* for version message */
 #include "jconfigint.h"
 
-#ifdef USE_CCOMMAND             /* command-line reader for Macintosh */
-#ifdef __MWERKS__
-#include <SIOUX.h>              /* Metrowerks needs this */
-#include <console.h>            /* ... and this */
-#endif
-#ifdef THINK_C
-#include <console.h>            /* Think declares it here */
-#endif
-#endif
-
 
 /* Create the add-on message string table. */
 
@@ -584,11 +574,6 @@
   unsigned long outsize = 0;
   JDIMENSION num_scanlines;
 
-  /* On Mac, fetch a command line. */
-#ifdef USE_CCOMMAND
-  argc = ccommand(&argv);
-#endif
-
   progname = argv[0];
   if (progname == NULL || progname[0] == 0)
     progname = "cjpeg";         /* in case C library doesn't provide it */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/cmakescripts/BuildPackages.cmake 
new/libjpeg-turbo-2.1.4/cmakescripts/BuildPackages.cmake
--- old/libjpeg-turbo-2.1.3/cmakescripts/BuildPackages.cmake    2022-02-25 
19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/cmakescripts/BuildPackages.cmake    2022-08-08 
23:03:55.000000000 +0200
@@ -109,10 +109,13 @@
 if(WITH_JAVA)
   set(JAVA_DEPEND turbojpeg-java)
 endif()
+if(WITH_TURBOJPEG)
+  set(TURBOJPEG_DEPEND turbojpeg turbojpeg-static tjbench)
+endif()
 add_custom_target(installer
   makensis -nocd ${INST_DEFS} installer.nsi
-  DEPENDS jpeg jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom
-    cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND}
+  DEPENDS jpeg jpeg-static rdjpgcom wrjpgcom cjpeg djpeg jpegtran
+    ${JAVA_DEPEND} ${TURBOJPEG_DEPEND}
   SOURCES installer.nsi)
 
 endif() # WIN32
@@ -159,7 +162,9 @@
 
 configure_file(release/libjpeg.pc.in pkgscripts/libjpeg.pc @ONLY)
 
-configure_file(release/libturbojpeg.pc.in pkgscripts/libturbojpeg.pc @ONLY)
+if(WITH_TURBOJPEG)
+  configure_file(release/libturbojpeg.pc.in pkgscripts/libturbojpeg.pc @ONLY)
+endif()
 
 include(CMakePackageConfigHelpers)
 write_basic_package_version_file(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/djpeg.c 
new/libjpeg-turbo-2.1.4/djpeg.c
--- old/libjpeg-turbo-2.1.3/djpeg.c     2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/djpeg.c     2022-08-08 23:03:55.000000000 +0200
@@ -38,16 +38,6 @@
 
 #include <ctype.h>              /* to declare isprint() */
 
-#ifdef USE_CCOMMAND             /* command-line reader for Macintosh */
-#ifdef __MWERKS__
-#include <SIOUX.h>              /* Metrowerks needs this */
-#include <console.h>            /* ... and this */
-#endif
-#ifdef THINK_C
-#include <console.h>            /* Think declares it here */
-#endif
-#endif
-
 
 /* Create the add-on message string table. */
 
@@ -550,11 +540,6 @@
 #endif
   JDIMENSION num_scanlines;
 
-  /* On Mac, fetch a command line. */
-#ifdef USE_CCOMMAND
-  argc = ccommand(&argv);
-#endif
-
   progname = argv[0];
   if (progname == NULL || progname[0] == 0)
     progname = "djpeg";         /* in case C library doesn't provide it */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/doc/html/annotated.html 
new/libjpeg-turbo-2.1.4/doc/html/annotated.html
--- old/libjpeg-turbo-2.1.3/doc/html/annotated.html     2022-02-25 
19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/doc/html/annotated.html     2022-08-08 
23:03:55.000000000 +0200
@@ -23,7 +23,7 @@
  <tr style="height: 56px;">
   <td id="projectalign" style="padding-left: 0.5em;">
    <div id="projectname">TurboJPEG
-   &#160;<span id="projectnumber">2.1</span>
+   &#160;<span id="projectnumber">2.1.4</span>
    </div>
   </td>
  </tr>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/doc/html/classes.html 
new/libjpeg-turbo-2.1.4/doc/html/classes.html
--- old/libjpeg-turbo-2.1.3/doc/html/classes.html       2022-02-25 
19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/doc/html/classes.html       2022-08-08 
23:03:55.000000000 +0200
@@ -23,7 +23,7 @@
  <tr style="height: 56px;">
   <td id="projectalign" style="padding-left: 0.5em;">
    <div id="projectname">TurboJPEG
-   &#160;<span id="projectnumber">2.1</span>
+   &#160;<span id="projectnumber">2.1.4</span>
    </div>
   </td>
  </tr>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/doc/html/functions.html 
new/libjpeg-turbo-2.1.4/doc/html/functions.html
--- old/libjpeg-turbo-2.1.3/doc/html/functions.html     2022-02-25 
19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/doc/html/functions.html     2022-08-08 
23:03:55.000000000 +0200
@@ -23,7 +23,7 @@
  <tr style="height: 56px;">
   <td id="projectalign" style="padding-left: 0.5em;">
    <div id="projectname">TurboJPEG
-   &#160;<span id="projectnumber">2.1</span>
+   &#160;<span id="projectnumber">2.1.4</span>
    </div>
   </td>
  </tr>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/doc/html/functions_vars.html 
new/libjpeg-turbo-2.1.4/doc/html/functions_vars.html
--- old/libjpeg-turbo-2.1.3/doc/html/functions_vars.html        2022-02-25 
19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/doc/html/functions_vars.html        2022-08-08 
23:03:55.000000000 +0200
@@ -23,7 +23,7 @@
  <tr style="height: 56px;">
   <td id="projectalign" style="padding-left: 0.5em;">
    <div id="projectname">TurboJPEG
-   &#160;<span id="projectnumber">2.1</span>
+   &#160;<span id="projectnumber">2.1.4</span>
    </div>
   </td>
  </tr>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libjpeg-turbo-2.1.3/doc/html/group___turbo_j_p_e_g.html 
new/libjpeg-turbo-2.1.4/doc/html/group___turbo_j_p_e_g.html
--- old/libjpeg-turbo-2.1.3/doc/html/group___turbo_j_p_e_g.html 2022-02-25 
19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/doc/html/group___turbo_j_p_e_g.html 2022-08-08 
23:03:55.000000000 +0200
@@ -23,7 +23,7 @@
  <tr style="height: 56px;">
   <td id="projectalign" style="padding-left: 0.5em;">
    <div id="projectname">TurboJPEG
-   &#160;<span id="projectnumber">2.1</span>
+   &#160;<span id="projectnumber">2.1.4</span>
    </div>
   </td>
  </tr>
@@ -273,7 +273,7 @@
 <tr class="memdesc:ga52300eac3f3d9ef4bab303bc244f62d3"><td 
class="mdescLeft">&#160;</td><td class="mdescRight">Create a TurboJPEG 
decompressor instance.  <a 
href="group___turbo_j_p_e_g.html#ga52300eac3f3d9ef4bab303bc244f62d3">More...</a><br
 /></td></tr>
 <tr class="separator:ga52300eac3f3d9ef4bab303bc244f62d3"><td 
class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:ga0595681096bba7199cc6f3533cb25f77"><td class="memItemLeft" 
align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" 
valign="bottom"><a class="el" 
href="group___turbo_j_p_e_g.html#ga0595681096bba7199cc6f3533cb25f77">tjDecompressHeader3</a>
 (<a class="el" 
href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>
 handle, const unsigned char *jpegBuf, unsigned long jpegSize, int *width, int 
*height, int *jpegSubsamp, int *jpegColorspace)</td></tr>
-<tr class="memdesc:ga0595681096bba7199cc6f3533cb25f77"><td 
class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve information about 
a JPEG image without decompressing it.  <a 
href="group___turbo_j_p_e_g.html#ga0595681096bba7199cc6f3533cb25f77">More...</a><br
 /></td></tr>
+<tr class="memdesc:ga0595681096bba7199cc6f3533cb25f77"><td 
class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve information about 
a JPEG image without decompressing it, or prime the decompressor with 
quantization and Huffman tables.  <a 
href="group___turbo_j_p_e_g.html#ga0595681096bba7199cc6f3533cb25f77">More...</a><br
 /></td></tr>
 <tr class="separator:ga0595681096bba7199cc6f3533cb25f77"><td 
class="memSeparator" colspan="2">&#160;</td></tr>
 <tr class="memitem:gac3854476006b10787bd128f7ede48057"><td class="memItemLeft" 
align="right" valign="top">DLLEXPORT <a class="el" 
href="structtjscalingfactor.html">tjscalingfactor</a> *&#160;</td><td 
class="memItemRight" valign="bottom"><a class="el" 
href="group___turbo_j_p_e_g.html#gac3854476006b10787bd128f7ede48057">tjGetScalingFactors</a>
 (int *numscalingfactors)</td></tr>
 <tr class="memdesc:gac3854476006b10787bd128f7ede48057"><td 
class="mdescLeft">&#160;</td><td class="mdescRight">Returns a list of 
fractional scaling factors that the JPEG decompressor in this implementation of 
TurboJPEG supports.  <a 
href="group___turbo_j_p_e_g.html#gac3854476006b10787bd128f7ede48057">More...</a><br
 /></td></tr>
@@ -1725,16 +1725,16 @@
       </table>
 </div><div class="memdoc">
 
-<p>Retrieve information about a JPEG image without decompressing it. </p>
+<p>Retrieve information about a JPEG image without decompressing it, or prime 
the decompressor with quantization and Huffman tables. </p>
 <dl class="params"><dt>Parameters</dt><dd>
   <table class="params">
     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG 
decompressor or transformer instance</td></tr>
-    <tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing a 
JPEG image</td></tr>
-    <tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in 
bytes)</td></tr>
-    <tr><td class="paramname">width</td><td>pointer to an integer variable 
that will receive the width (in pixels) of the JPEG image</td></tr>
-    <tr><td class="paramname">height</td><td>pointer to an integer variable 
that will receive the height (in pixels) of the JPEG image</td></tr>
-    <tr><td class="paramname">jpegSubsamp</td><td>pointer to an integer 
variable that will receive the level of chrominance subsampling used when the 
JPEG image was compressed (see <a class="el" 
href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance
 subsampling options</a>.)</td></tr>
-    <tr><td class="paramname">jpegColorspace</td><td>pointer to an integer 
variable that will receive one of the JPEG colorspace constants, indicating the 
colorspace of the JPEG image (see <a class="el" 
href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">JPEG 
colorspaces</a>.)</td></tr>
+    <tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing a 
JPEG image or an "abbreviated table specification" (AKA "tables-only") 
datastream. Passing a tables-only datastream to this function primes the 
decompressor with quantization and Huffman tables that can be used when 
decompressing subsequent "abbreviated image" datastreams. This is useful, for 
instance, when decompressing video streams in which all frames share the same 
quantization and Huffman tables.</td></tr>
+    <tr><td class="paramname">jpegSize</td><td>size of the JPEG image or 
tables-only datastream (in bytes)</td></tr>
+    <tr><td class="paramname">width</td><td>pointer to an integer variable 
that will receive the width (in pixels) of the JPEG image. If 
<code>jpegBuf</code> points to a tables-only datastream, then 
<code>width</code> is ignored.</td></tr>
+    <tr><td class="paramname">height</td><td>pointer to an integer variable 
that will receive the height (in pixels) of the JPEG image. If 
<code>jpegBuf</code> points to a tables-only datastream, then 
<code>height</code> is ignored.</td></tr>
+    <tr><td class="paramname">jpegSubsamp</td><td>pointer to an integer 
variable that will receive the level of chrominance subsampling used when the 
JPEG image was compressed (see <a class="el" 
href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance
 subsampling options</a>.) If <code>jpegBuf</code> points to a tables-only 
datastream, then <code>jpegSubsamp</code> is ignored.</td></tr>
+    <tr><td class="paramname">jpegColorspace</td><td>pointer to an integer 
variable that will receive one of the JPEG colorspace constants, indicating the 
colorspace of the JPEG image (see <a class="el" 
href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">JPEG 
colorspaces</a>.) If <code>jpegBuf</code> points to a tables-only datastream, 
then <code>jpegColorspace</code> is ignored.</td></tr>
   </table>
   </dd>
 </dl>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/doc/html/index.html 
new/libjpeg-turbo-2.1.4/doc/html/index.html
--- old/libjpeg-turbo-2.1.3/doc/html/index.html 2022-02-25 19:53:05.000000000 
+0100
+++ new/libjpeg-turbo-2.1.4/doc/html/index.html 2022-08-08 23:03:55.000000000 
+0200
@@ -23,7 +23,7 @@
  <tr style="height: 56px;">
   <td id="projectalign" style="padding-left: 0.5em;">
    <div id="projectname">TurboJPEG
-   &#160;<span id="projectnumber">2.1</span>
+   &#160;<span id="projectnumber">2.1.4</span>
    </div>
   </td>
  </tr>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/doc/html/modules.html 
new/libjpeg-turbo-2.1.4/doc/html/modules.html
--- old/libjpeg-turbo-2.1.3/doc/html/modules.html       2022-02-25 
19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/doc/html/modules.html       2022-08-08 
23:03:55.000000000 +0200
@@ -23,7 +23,7 @@
  <tr style="height: 56px;">
   <td id="projectalign" style="padding-left: 0.5em;">
    <div id="projectname">TurboJPEG
-   &#160;<span id="projectnumber">2.1</span>
+   &#160;<span id="projectnumber">2.1.4</span>
    </div>
   </td>
  </tr>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/doc/html/structtjregion.html 
new/libjpeg-turbo-2.1.4/doc/html/structtjregion.html
--- old/libjpeg-turbo-2.1.3/doc/html/structtjregion.html        2022-02-25 
19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/doc/html/structtjregion.html        2022-08-08 
23:03:55.000000000 +0200
@@ -23,7 +23,7 @@
  <tr style="height: 56px;">
   <td id="projectalign" style="padding-left: 0.5em;">
    <div id="projectname">TurboJPEG
-   &#160;<span id="projectnumber">2.1</span>
+   &#160;<span id="projectnumber">2.1.4</span>
    </div>
   </td>
  </tr>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libjpeg-turbo-2.1.3/doc/html/structtjscalingfactor.html 
new/libjpeg-turbo-2.1.4/doc/html/structtjscalingfactor.html
--- old/libjpeg-turbo-2.1.3/doc/html/structtjscalingfactor.html 2022-02-25 
19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/doc/html/structtjscalingfactor.html 2022-08-08 
23:03:55.000000000 +0200
@@ -23,7 +23,7 @@
  <tr style="height: 56px;">
   <td id="projectalign" style="padding-left: 0.5em;">
    <div id="projectname">TurboJPEG
-   &#160;<span id="projectnumber">2.1</span>
+   &#160;<span id="projectnumber">2.1.4</span>
    </div>
   </td>
  </tr>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/doc/html/structtjtransform.html 
new/libjpeg-turbo-2.1.4/doc/html/structtjtransform.html
--- old/libjpeg-turbo-2.1.3/doc/html/structtjtransform.html     2022-02-25 
19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/doc/html/structtjtransform.html     2022-08-08 
23:03:55.000000000 +0200
@@ -23,7 +23,7 @@
  <tr style="height: 56px;">
   <td id="projectalign" style="padding-left: 0.5em;">
    <div id="projectname">TurboJPEG
-   &#160;<span id="projectnumber">2.1</span>
+   &#160;<span id="projectnumber">2.1.4</span>
    </div>
   </td>
  </tr>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/doxygen.config 
new/libjpeg-turbo-2.1.4/doxygen.config
--- old/libjpeg-turbo-2.1.3/doxygen.config      2022-02-25 19:53:05.000000000 
+0100
+++ new/libjpeg-turbo-2.1.4/doxygen.config      2022-08-08 23:03:55.000000000 
+0200
@@ -1,5 +1,5 @@
 PROJECT_NAME = TurboJPEG
-PROJECT_NUMBER = 2.1
+PROJECT_NUMBER = 2.1.4
 OUTPUT_DIRECTORY = doc/
 USE_WINDOWS_ENCODING = NO
 OPTIMIZE_OUTPUT_FOR_C = YES
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/example.txt 
new/libjpeg-turbo-2.1.4/example.txt
--- old/libjpeg-turbo-2.1.3/example.txt 2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/example.txt 2022-08-08 23:03:55.000000000 +0200
@@ -311,7 +311,7 @@
  * We call the libjpeg API from within a separate function, because modifying
  * the local non-volatile jpeg_decompress_struct instance below the setjmp()
  * return point and then accessing the instance after setjmp() returns would
- * return in undefined behavior that may potentially overwrite all or part of
+ * result in undefined behavior that may potentially overwrite all or part of
  * the structure.
  */
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/fuzz/CMakeLists.txt 
new/libjpeg-turbo-2.1.4/fuzz/CMakeLists.txt
--- old/libjpeg-turbo-2.1.3/fuzz/CMakeLists.txt 2022-02-25 19:53:05.000000000 
+0100
+++ new/libjpeg-turbo-2.1.4/fuzz/CMakeLists.txt 2022-08-08 23:03:55.000000000 
+0200
@@ -25,16 +25,20 @@
   "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
 message(STATUS "C++ Compiler flags = ${EFFECTIVE_CXX_FLAGS}")
 
-add_executable(cjpeg_fuzzer cjpeg.cc ../cdjpeg.c ../rdbmp.c ../rdgif.c
-  ../rdppm.c ../rdswitch.c ../rdtarga.c)
-set_property(TARGET cjpeg_fuzzer PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
-target_link_libraries(cjpeg_fuzzer ${FUZZ_LIBRARY} jpeg-static)
-install(TARGETS cjpeg_fuzzer RUNTIME DESTINATION ${FUZZ_BINDIR})
+add_executable(cjpeg_fuzzer${FUZZER_SUFFIX} cjpeg.cc ../cdjpeg.c ../rdbmp.c
+  ../rdgif.c ../rdppm.c ../rdswitch.c ../rdtarga.c)
+set_property(TARGET cjpeg_fuzzer${FUZZER_SUFFIX} PROPERTY COMPILE_FLAGS
+  ${COMPILE_FLAGS})
+target_link_libraries(cjpeg_fuzzer${FUZZER_SUFFIX} ${FUZZ_LIBRARY} jpeg-static)
+install(TARGETS cjpeg_fuzzer${FUZZER_SUFFIX} RUNTIME DESTINATION
+  ${FUZZ_BINDIR})
 
 macro(add_fuzz_target target source_file)
-  add_executable(${target}_fuzzer ${source_file})
-  target_link_libraries(${target}_fuzzer ${FUZZ_LIBRARY} turbojpeg-static)
-  install(TARGETS ${target}_fuzzer RUNTIME DESTINATION ${FUZZ_BINDIR})
+  add_executable(${target}_fuzzer${FUZZER_SUFFIX} ${source_file})
+  target_link_libraries(${target}_fuzzer${FUZZER_SUFFIX} ${FUZZ_LIBRARY}
+    turbojpeg-static)
+  install(TARGETS ${target}_fuzzer${FUZZER_SUFFIX} RUNTIME DESTINATION
+    ${FUZZ_BINDIR})
 endmacro()
 
 add_fuzz_target(compress compress.cc)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/fuzz/build.sh 
new/libjpeg-turbo-2.1.4/fuzz/build.sh
--- old/libjpeg-turbo-2.1.3/fuzz/build.sh       2022-02-25 19:53:05.000000000 
+0100
+++ new/libjpeg-turbo-2.1.4/fuzz/build.sh       2022-08-08 23:03:55.000000000 
+0200
@@ -3,16 +3,23 @@
 set -u
 set -e
 
+FUZZER_SUFFIX=
+if [ $# -ge 1 ]; then
+       FUZZER_SUFFIX="$1"
+       FUZZER_SUFFIX="`echo $1 | sed 's/\./_/g'`"
+fi
+
 cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_STATIC=1 -DENABLE_SHARED=0 \
        -DCMAKE_C_FLAGS_RELWITHDEBINFO="-g -DNDEBUG" \
        -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-g -DNDEBUG" 
-DCMAKE_INSTALL_PREFIX=$WORK \
-       -DWITH_FUZZ=1 -DFUZZ_BINDIR=$OUT -DFUZZ_LIBRARY=$LIB_FUZZING_ENGINE
+       -DWITH_FUZZ=1 -DFUZZ_BINDIR=$OUT -DFUZZ_LIBRARY=$LIB_FUZZING_ENGINE \
+       -DFUZZER_SUFFIX="$FUZZER_SUFFIX"
 make "-j$(nproc)" "--load-average=$(nproc)"
 make install
 
-cp $SRC/compress_fuzzer_seed_corpus.zip $OUT/cjpeg_fuzzer_seed_corpus.zip
-cp $SRC/compress_fuzzer_seed_corpus.zip $OUT/compress_fuzzer_seed_corpus.zip
-cp $SRC/compress_fuzzer_seed_corpus.zip 
$OUT/compress_yuv_fuzzer_seed_corpus.zip
-cp $SRC/decompress_fuzzer_seed_corpus.zip 
$OUT/libjpeg_turbo_fuzzer_seed_corpus.zip
-cp $SRC/decompress_fuzzer_seed_corpus.zip 
$OUT/decompress_yuv_fuzzer_seed_corpus.zip
-cp $SRC/decompress_fuzzer_seed_corpus.zip $OUT/transform_fuzzer_seed_corpus.zip
+cp $SRC/compress_fuzzer_seed_corpus.zip 
$OUT/cjpeg_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip
+cp $SRC/compress_fuzzer_seed_corpus.zip 
$OUT/compress_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip
+cp $SRC/compress_fuzzer_seed_corpus.zip 
$OUT/compress_yuv_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip
+cp $SRC/decompress_fuzzer_seed_corpus.zip 
$OUT/libjpeg_turbo_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip
+cp $SRC/decompress_fuzzer_seed_corpus.zip 
$OUT/decompress_yuv_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip
+cp $SRC/decompress_fuzzer_seed_corpus.zip 
$OUT/transform_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/java/doc/index-all.html 
new/libjpeg-turbo-2.1.4/java/doc/index-all.html
--- old/libjpeg-turbo-2.1.3/java/doc/index-all.html     2022-02-25 
19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/java/doc/index-all.html     2022-08-08 
23:03:55.000000000 +0200
@@ -792,7 +792,8 @@
 </dd>
 <dt><span class="strong"><a 
href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)">setSourceImage(byte[],
 int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a 
href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in 
org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
 <dd>
-<div class="block">Associate the JPEG image of length <code>imageSize</code> 
bytes stored in
+<div class="block">Associate the JPEG image or "abbreviated table 
specification" (AKA
+ "tables-only") datastream of length <code>imageSize</code> bytes stored in
  <code>jpegImage</code> with this decompressor instance.</div>
 </dd>
 <dt><span class="strong"><a 
href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage(YUVImage)</a></span>
 - Method in class org.libjpegturbo.turbojpeg.<a 
href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in 
org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libjpeg-turbo-2.1.3/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html 
new/libjpeg-turbo-2.1.4/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html
--- 
old/libjpeg-turbo-2.1.3/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html 
    2022-02-25 19:53:05.000000000 +0100
+++ 
new/libjpeg-turbo-2.1.4/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html 
    2022-08-08 23:03:55.000000000 +0200
@@ -418,7 +418,8 @@
 <td class="colFirst"><code>void</code></td>
 <td class="colLast"><code><strong><a 
href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)">setSourceImage</a></strong>(byte[]&nbsp;jpegImage,
               int&nbsp;imageSize)</code>
-<div class="block">Associate the JPEG image of length <code>imageSize</code> 
bytes stored in
+<div class="block">Associate the JPEG image or "abbreviated table 
specification" (AKA
+ "tables-only") datastream of length <code>imageSize</code> bytes stored in
  <code>jpegImage</code> with this decompressor instance.</div>
 </td>
 </tr>
@@ -611,10 +612,19 @@
 <pre>public&nbsp;void&nbsp;setSourceImage(byte[]&nbsp;jpegImage,
                   int&nbsp;imageSize)
                     throws <a 
href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in 
org.libjpegturbo.turbojpeg">TJException</a></pre>
-<div class="block">Associate the JPEG image of length <code>imageSize</code> 
bytes stored in
- <code>jpegImage</code> with this decompressor instance.  This image will
- be used as the source image for subsequent decompress operations.</div>
-<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> 
- JPEG image buffer.  This buffer is not 
modified.</dd><dd><code>imageSize</code> - size of the JPEG image (in 
bytes)</dd>
+<div class="block">Associate the JPEG image or "abbreviated table 
specification" (AKA
+ "tables-only") datastream of length <code>imageSize</code> bytes stored in
+ <code>jpegImage</code> with this decompressor instance.  If
+ <code>jpegImage</code> contains a JPEG image, then this image will be used
+ as the source image for subsequent decompress operations.  Passing a
+ tables-only datastream to this method primes the decompressor with
+ quantization and Huffman tables that can be used when decompressing
+ subsequent "abbreviated image" datastreams.  This is useful, for instance,
+ when decompressing video streams in which all frames share the same
+ quantization and Huffman tables.</div>
+<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> 
- buffer containing a JPEG image or an "abbreviated table
+ specification" (AKA "tables-only") datastream.  This buffer is not
+ modified.</dd><dd><code>imageSize</code> - size of the JPEG image (in 
bytes)</dd>
 <dt><span class="strong">Throws:</span></dt>
 <dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" 
title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
 </li>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libjpeg-turbo-2.1.3/java/org/libjpegturbo/turbojpeg/TJDecompressor.java 
new/libjpeg-turbo-2.1.4/java/org/libjpegturbo/turbojpeg/TJDecompressor.java
--- old/libjpeg-turbo-2.1.3/java/org/libjpegturbo/turbojpeg/TJDecompressor.java 
2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/java/org/libjpegturbo/turbojpeg/TJDecompressor.java 
2022-08-08 23:03:55.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (C)2011-2015, 2018 D. R. Commander.  All Rights Reserved.
+ * Copyright (C)2011-2015, 2018, 2022 D. R. Commander.  All Rights Reserved.
  * Copyright (C)2015 Viktor Szathm??ry.  All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -89,11 +89,20 @@
   }
 
   /**
-   * Associate the JPEG image of length <code>imageSize</code> bytes stored in
-   * <code>jpegImage</code> with this decompressor instance.  This image will
-   * be used as the source image for subsequent decompress operations.
-   *
-   * @param jpegImage JPEG image buffer.  This buffer is not modified.
+   * Associate the JPEG image or "abbreviated table specification" (AKA
+   * "tables-only") datastream of length <code>imageSize</code> bytes stored in
+   * <code>jpegImage</code> with this decompressor instance.  If
+   * <code>jpegImage</code> contains a JPEG image, then this image will be used
+   * as the source image for subsequent decompress operations.  Passing a
+   * tables-only datastream to this method primes the decompressor with
+   * quantization and Huffman tables that can be used when decompressing
+   * subsequent "abbreviated image" datastreams.  This is useful, for instance,
+   * when decompressing video streams in which all frames share the same
+   * quantization and Huffman tables.
+   *
+   * @param jpegImage buffer containing a JPEG image or an "abbreviated table
+   * specification" (AKA "tables-only") datastream.  This buffer is not
+   * modified.
    *
    * @param imageSize size of the JPEG image (in bytes)
    */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/jdapistd.c 
new/libjpeg-turbo-2.1.4/jdapistd.c
--- old/libjpeg-turbo-2.1.3/jdapistd.c  2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/jdapistd.c  2022-08-08 23:03:55.000000000 +0200
@@ -159,9 +159,12 @@
   JDIMENSION input_xoffset;
   boolean reinit_upsampler = FALSE;
   jpeg_component_info *compptr;
+#ifdef UPSAMPLE_MERGING_SUPPORTED
   my_master_ptr master = (my_master_ptr)cinfo->master;
+#endif
 
-  if (cinfo->global_state != DSTATE_SCANNING || cinfo->output_scanline != 0)
+  if ((cinfo->global_state != DSTATE_SCANNING &&
+       cinfo->global_state != DSTATE_BUFIMAGE) || cinfo->output_scanline != 0)
     ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
 
   if (!xoffset || !width)
@@ -209,11 +212,13 @@
    */
   *width = *width + input_xoffset - *xoffset;
   cinfo->output_width = *width;
+#ifdef UPSAMPLE_MERGING_SUPPORTED
   if (master->using_merged_upsample && cinfo->max_v_samp_factor == 2) {
     my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
     upsample->out_row_width =
       cinfo->output_width * cinfo->out_color_components;
   }
+#endif
 
   /* Set the first and last iMCU columns that we must decompress.  These values
    * will be used in single-scan decompressions.
@@ -324,7 +329,9 @@
 read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
 {
   JDIMENSION n;
+#ifdef UPSAMPLE_MERGING_SUPPORTED
   my_master_ptr master = (my_master_ptr)cinfo->master;
+#endif
   JSAMPLE dummy_sample[1] = { 0 };
   JSAMPROW dummy_row = dummy_sample;
   JSAMPARRAY scanlines = NULL;
@@ -348,10 +355,12 @@
     cinfo->cquantize->color_quantize = noop_quantize;
   }
 
+#ifdef UPSAMPLE_MERGING_SUPPORTED
   if (master->using_merged_upsample && cinfo->max_v_samp_factor == 2) {
     my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
     scanlines = &upsample->spare_row;
   }
+#endif
 
   for (n = 0; n < num_lines; n++)
     jpeg_read_scanlines(cinfo, scanlines, 1);
@@ -517,7 +526,7 @@
    * all of the entropy decoding occurs in jpeg_start_decompress(), assuming
    * that the input data source is non-suspending.  This makes skipping easy.
    */
-  if (cinfo->inputctl->has_multiple_scans) {
+  if (cinfo->inputctl->has_multiple_scans || cinfo->buffered_image) {
     if (cinfo->upsample->need_context_rows) {
       cinfo->output_scanline += lines_to_skip;
       cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/jdcoefct.c 
new/libjpeg-turbo-2.1.4/jdcoefct.c
--- old/libjpeg-turbo-2.1.3/jdcoefct.c  2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/jdcoefct.c  2022-08-08 23:03:55.000000000 +0200
@@ -5,7 +5,7 @@
  * Copyright (C) 1994-1997, Thomas G. Lane.
  * libjpeg-turbo Modifications:
  * Copyright 2009 Pierre Ossman <oss...@cendio.se> for Cendio AB
- * Copyright (C) 2010, 2015-2016, 2019-2020, D. R. Commander.
+ * Copyright (C) 2010, 2015-2016, 2019-2020, 2022, D. R. Commander.
  * Copyright (C) 2015, 2020, Google, Inc.
  * For conditions of distribution and use, see the accompanying README.ijg
  * file.
@@ -475,7 +475,7 @@
     if (!compptr->component_needed)
       continue;
     /* Count non-dummy DCT block rows in this iMCU row. */
-    if (cinfo->output_iMCU_row < last_iMCU_row - 1) {
+    if (cinfo->output_iMCU_row + 1 < last_iMCU_row) {
       block_rows = compptr->v_samp_factor;
       access_rows = block_rows * 3; /* this and next two iMCU rows */
     } else if (cinfo->output_iMCU_row < last_iMCU_row) {
@@ -560,7 +560,7 @@
         next_block_row = buffer_ptr;
 
       if (block_row < block_rows - 2 ||
-          cinfo->output_iMCU_row < last_iMCU_row - 1)
+          cinfo->output_iMCU_row + 1 < last_iMCU_row)
         next_next_block_row =
           buffer[block_row + 2] + cinfo->master->first_MCU_col[ci];
       else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/jerror.c 
new/libjpeg-turbo-2.1.4/jerror.c
--- old/libjpeg-turbo-2.1.3/jerror.c    2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/jerror.c    2022-08-08 23:03:55.000000000 +0200
@@ -189,9 +189,9 @@
 
   /* Format the message into the passed buffer */
   if (isstring)
-    snprintf(buffer, JMSG_LENGTH_MAX, msgtext, err->msg_parm.s);
+    SNPRINTF(buffer, JMSG_LENGTH_MAX, msgtext, err->msg_parm.s);
   else
-    snprintf(buffer, JMSG_LENGTH_MAX, msgtext,
+    SNPRINTF(buffer, JMSG_LENGTH_MAX, msgtext,
              err->msg_parm.i[0], err->msg_parm.i[1],
              err->msg_parm.i[2], err->msg_parm.i[3],
              err->msg_parm.i[4], err->msg_parm.i[5],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/jinclude.h 
new/libjpeg-turbo-2.1.4/jinclude.h
--- old/libjpeg-turbo-2.1.3/jinclude.h  2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/jinclude.h  2022-08-08 23:03:55.000000000 +0200
@@ -45,6 +45,18 @@
  */
 
 
+#ifdef _MSC_VER
+
+#define SNPRINTF(str, n, format, ...) \
+  _snprintf_s(str, n, _TRUNCATE, format, ##__VA_ARGS__)
+
+#else
+
+#define SNPRINTF  snprintf
+
+#endif
+
+
 #ifndef NO_GETENV
 
 #ifdef _MSC_VER
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/jmemmgr.c 
new/libjpeg-turbo-2.1.4/jmemmgr.c
--- old/libjpeg-turbo-2.1.3/jmemmgr.c   2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/jmemmgr.c   2022-08-08 23:03:55.000000000 +0200
@@ -68,10 +68,13 @@
  * There isn't any really portable way to determine the worst-case alignment
  * requirement.  This module assumes that the alignment requirement is
  * multiples of ALIGN_SIZE.
- * By default, we define ALIGN_SIZE as sizeof(double).  This is necessary on
- * some workstations (where doubles really do need 8-byte alignment) and will
- * work fine on nearly everything.  If your machine has lesser alignment needs,
- * you can save a few bytes by making ALIGN_SIZE smaller.
+ * By default, we define ALIGN_SIZE as the maximum of sizeof(double) and
+ * sizeof(void *).  This is necessary on some workstations (where doubles
+ * really do need 8-byte alignment) and will work fine on nearly everything.
+ * We use the maximum of sizeof(double) and sizeof(void *) since sizeof(double)
+ * may be insufficient, for example, on CHERI-enabled platforms with 16-byte
+ * pointers and a 16-byte alignment requirement.  If your machine has lesser
+ * alignment needs, you can save a few bytes by making ALIGN_SIZE smaller.
  * The only place I know of where this will NOT work is certain Macintosh
  * 680x0 compilers that define double as a 10-byte IEEE extended float.
  * Doing 10-byte alignment is counterproductive because longwords won't be
@@ -81,7 +84,7 @@
 
 #ifndef ALIGN_SIZE              /* so can override from jconfig.h */
 #ifndef WITH_SIMD
-#define ALIGN_SIZE  sizeof(double)
+#define ALIGN_SIZE  MAX(sizeof(void *), sizeof(double))
 #else
 #define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
                           16-byte (128-bit) alignment, but AVX2 requires
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/jpegtran.c 
new/libjpeg-turbo-2.1.4/jpegtran.c
--- old/libjpeg-turbo-2.1.3/jpegtran.c  2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/jpegtran.c  2022-08-08 23:03:55.000000000 +0200
@@ -23,16 +23,6 @@
 #include "jversion.h"           /* for version message */
 #include "jconfigint.h"
 
-#ifdef USE_CCOMMAND             /* command-line reader for Macintosh */
-#ifdef __MWERKS__
-#include <SIOUX.h>              /* Metrowerks needs this */
-#include <console.h>            /* ... and this */
-#endif
-#ifdef THINK_C
-#include <console.h>            /* Think declares it here */
-#endif
-#endif
-
 
 /*
  * Argument-parsing code.
@@ -483,11 +473,6 @@
   JOCTET *icc_profile = NULL;
   long icc_len = 0;
 
-  /* On Mac, fetch a command line. */
-#ifdef USE_CCOMMAND
-  argc = ccommand(&argv);
-#endif
-
   progname = argv[0];
   if (progname == NULL || progname[0] == 0)
     progname = "jpegtran";      /* in case C library doesn't provide it */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/libjpeg.txt 
new/libjpeg-turbo-2.1.4/libjpeg.txt
--- old/libjpeg-turbo-2.1.3/libjpeg.txt 2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/libjpeg.txt 2022-08-08 23:03:55.000000000 +0200
@@ -3,7 +3,7 @@
 This file was part of the Independent JPEG Group's software:
 Copyright (C) 1994-2013, Thomas G. Lane, Guido Vollbeding.
 libjpeg-turbo Modifications:
-Copyright (C) 2010, 2014-2018, 2020, D. R. Commander.
+Copyright (C) 2010, 2014-2018, 2020, 2022, D. R. Commander.
 Copyright (C) 2015, Google, Inc.
 For conditions of distribution and use, see the accompanying README.ijg file.
 
@@ -840,18 +840,7 @@
 machines) and reference it at your link step.  If you use only half of the
 library (only compression or only decompression), only that much code will be
 included from the library, unless your linker is hopelessly brain-damaged.
-The supplied makefiles build libjpeg.a automatically (see install.txt).
-
-While you can build the JPEG library as a shared library if the whim strikes
-you, we don't really recommend it.  The trouble with shared libraries is that
-at some point you'll probably try to substitute a new version of the library
-without recompiling the calling applications.  That generally doesn't work
-because the parameter struct declarations usually change with each new
-version.  In other words, the library's API is *not* guaranteed binary
-compatible across versions; we only try to ensure source-code compatibility.
-(In hindsight, it might have been smarter to hide the parameter structs from
-applications and introduce a ton of access functions instead.  Too late now,
-however.)
+The supplied build system builds libjpeg.a automatically.
 
 It may be worth pointing out that the core JPEG library does not actually
 require the stdio library: only the default source/destination managers and
@@ -3075,9 +3064,8 @@
 larger than a char, so it affects the surrounding application's image data.
 The sample applications cjpeg and djpeg can support 12-bit mode only for PPM
 and GIF file formats; you must disable the other file formats to compile a
-12-bit cjpeg or djpeg.  (install.txt has more information about that.)
-At present, a 12-bit library can handle *only* 12-bit images, not both
-precisions.
+12-bit cjpeg or djpeg.  At present, a 12-bit library can handle *only* 12-bit
+images, not both precisions.
 
 Note that a 12-bit library always compresses in Huffman optimization mode,
 in order to generate valid Huffman tables.  This is necessary because our
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/rdjpgcom.c 
new/libjpeg-turbo-2.1.4/rdjpgcom.c
--- old/libjpeg-turbo-2.1.3/rdjpgcom.c  2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/rdjpgcom.c  2022-08-08 23:03:55.000000000 +0200
@@ -30,16 +30,6 @@
 #include <io.h>                 /* to declare setmode() */
 #endif
 
-#ifdef USE_CCOMMAND             /* command-line reader for Macintosh */
-#ifdef __MWERKS__
-#include <SIOUX.h>              /* Metrowerks needs this */
-#include <console.h>            /* ... and this */
-#endif
-#ifdef THINK_C
-#include <console.h>            /* Think declares it here */
-#endif
-#endif
-
 #ifdef DONT_USE_B_MODE          /* define mode parameters for fopen() */
 #define READ_BINARY     "r"
 #else
@@ -450,11 +440,6 @@
   char *arg;
   int verbose = 0, raw = 0;
 
-  /* On Mac, fetch a command line. */
-#ifdef USE_CCOMMAND
-  argc = ccommand(&argv);
-#endif
-
   progname = argv[0];
   if (progname == NULL || progname[0] == 0)
     progname = "rdjpgcom";      /* in case C library doesn't provide it */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/simd/CMakeLists.txt 
new/libjpeg-turbo-2.1.4/simd/CMakeLists.txt
--- old/libjpeg-turbo-2.1.3/simd/CMakeLists.txt 2022-02-25 19:53:05.000000000 
+0100
+++ new/libjpeg-turbo-2.1.4/simd/CMakeLists.txt 2022-08-08 23:03:55.000000000 
+0200
@@ -449,6 +449,9 @@
 set(CMAKE_REQUIRED_FLAGS -Wa,-mloongson-mmi,-mloongson-ext)
 
 check_c_source_compiles("
+  #if !(defined(__mips__) && __mips_isa_rev < 6)
+  #error Loongson MMI can't work with MIPS Release 6+
+  #endif
   int main(void) {
     int c = 0, a = 0, b = 0;
     asm (
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/simd/arm/aarch32/jsimd.c 
new/libjpeg-turbo-2.1.4/simd/arm/aarch32/jsimd.c
--- old/libjpeg-turbo-2.1.3/simd/arm/aarch32/jsimd.c    2022-02-25 
19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/simd/arm/aarch32/jsimd.c    2022-08-08 
23:03:55.000000000 +0200
@@ -25,8 +25,6 @@
 #include "../../../jsimddct.h"
 #include "../../jsimd.h"
 
-#include <stdio.h>
-#include <string.h>
 #include <ctype.h>
 
 static unsigned int simd_support = ~0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/simd/arm/aarch64/jsimd.c 
new/libjpeg-turbo-2.1.4/simd/arm/aarch64/jsimd.c
--- old/libjpeg-turbo-2.1.3/simd/arm/aarch64/jsimd.c    2022-02-25 
19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/simd/arm/aarch64/jsimd.c    2022-08-08 
23:03:55.000000000 +0200
@@ -25,8 +25,6 @@
 #include "../../jsimd.h"
 #include "jconfigint.h"
 
-#include <stdio.h>
-#include <string.h>
 #include <ctype.h>
 
 #define JSIMD_FASTLD3  1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/simd/mips/jsimd.c 
new/libjpeg-turbo-2.1.4/simd/mips/jsimd.c
--- old/libjpeg-turbo-2.1.3/simd/mips/jsimd.c   2022-02-25 19:53:05.000000000 
+0100
+++ new/libjpeg-turbo-2.1.4/simd/mips/jsimd.c   2022-08-08 23:03:55.000000000 
+0200
@@ -23,8 +23,6 @@
 #include "../../jsimddct.h"
 #include "../jsimd.h"
 
-#include <stdio.h>
-#include <string.h>
 #include <ctype.h>
 
 static unsigned int simd_support = ~0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/simd/mips64/jsimd.c 
new/libjpeg-turbo-2.1.4/simd/mips64/jsimd.c
--- old/libjpeg-turbo-2.1.3/simd/mips64/jsimd.c 2022-02-25 19:53:05.000000000 
+0100
+++ new/libjpeg-turbo-2.1.4/simd/mips64/jsimd.c 2022-08-08 23:03:55.000000000 
+0200
@@ -24,8 +24,6 @@
 #include "../../jsimddct.h"
 #include "../jsimd.h"
 
-#include <stdio.h>
-#include <string.h>
 #include <ctype.h>
 
 static unsigned int simd_support = ~0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/simd/powerpc/jsimd.c 
new/libjpeg-turbo-2.1.4/simd/powerpc/jsimd.c
--- old/libjpeg-turbo-2.1.3/simd/powerpc/jsimd.c        2022-02-25 
19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/simd/powerpc/jsimd.c        2022-08-08 
23:03:55.000000000 +0200
@@ -27,11 +27,12 @@
 #include "../../jsimddct.h"
 #include "../jsimd.h"
 
-#include <stdio.h>
-#include <string.h>
 #include <ctype.h>
 
-#if defined(__OpenBSD__)
+#if defined(__APPLE__)
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#elif defined(__OpenBSD__)
 #include <sys/param.h>
 #include <sys/sysctl.h>
 #include <machine/cpu.h>
@@ -121,6 +122,10 @@
   int bufsize = 1024; /* an initial guess for the line buffer size limit */
 #elif defined(__amigaos4__)
   uint32 altivec = 0;
+#elif defined(__APPLE__)
+  int mib[2] = { CTL_HW, HW_VECTORUNIT };
+  int altivec;
+  size_t len = sizeof(altivec);
 #elif defined(__OpenBSD__)
   int mib[2] = { CTL_MACHDEP, CPU_ALTIVEC };
   int altivec;
@@ -134,7 +139,7 @@
 
   simd_support = 0;
 
-#if defined(__ALTIVEC__) || defined(__APPLE__)
+#if defined(__ALTIVEC__)
   simd_support |= JSIMD_ALTIVEC;
 #elif defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
   while (!parse_proc_cpuinfo(bufsize)) {
@@ -146,7 +151,7 @@
   IExec->GetCPUInfoTags(GCIT_VectorUnit, &altivec, TAG_DONE);
   if (altivec == VECTORTYPE_ALTIVEC)
     simd_support |= JSIMD_ALTIVEC;
-#elif defined(__OpenBSD__)
+#elif defined(__APPLE__) || defined(__OpenBSD__)
   if (sysctl(mib, 2, &altivec, &len, NULL, 0) == 0 && altivec != 0)
     simd_support |= JSIMD_ALTIVEC;
 #elif defined(__FreeBSD__)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/strtest.c 
new/libjpeg-turbo-2.1.4/strtest.c
--- old/libjpeg-turbo-2.1.3/strtest.c   2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/strtest.c   2022-08-08 23:03:55.000000000 +0200
@@ -27,6 +27,7 @@
  */
 
 #include "jinclude.h"
+#include <errno.h>
 
 
 #define CHECK_VALUE(actual, expected, desc) \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/tjbench.c 
new/libjpeg-turbo-2.1.4/tjbench.c
--- old/libjpeg-turbo-2.1.3/tjbench.c   2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/tjbench.c   2022-08-08 23:03:55.000000000 +0200
@@ -107,7 +107,7 @@
   if (cs == TJCS_YCbCr)
     return (char *)subNameLong[subsamp];
   else if (cs == TJCS_YCCK || cs == TJCS_CMYK) {
-    snprintf(buf, 80, "%s %s", csName[cs], subNameLong[subsamp]);
+    SNPRINTF(buf, 80, "%s %s", csName[cs], subNameLong[subsamp]);
     return buf;
   } else
     return (char *)csName[cs];
@@ -120,10 +120,10 @@
   int digitsAfterDecimal = figs - (int)ceil(log10(fabs(val)));
 
   if (digitsAfterDecimal < 1)
-    snprintf(format, 80, "%%.0f");
+    SNPRINTF(format, 80, "%%.0f");
   else
-    snprintf(format, 80, "%%.%df", digitsAfterDecimal);
-  snprintf(buf, len, format, val);
+    SNPRINTF(format, 80, "%%.%df", digitsAfterDecimal);
+  SNPRINTF(buf, len, format, val);
   return buf;
 }
 
@@ -160,7 +160,7 @@
   unsigned char *dstPtr, *dstPtr2, *yuvBuf = NULL;
 
   if (jpegQual > 0) {
-    snprintf(qualStr, 13, "_Q%d", jpegQual);
+    SNPRINTF(qualStr, 13, "_Q%d", jpegQual);
     qualStr[12] = 0;
   }
 
@@ -262,20 +262,20 @@
   if (!doWrite) goto bailout;
 
   if (sf.num != 1 || sf.denom != 1)
-    snprintf(sizeStr, 24, "%d_%d", sf.num, sf.denom);
+    SNPRINTF(sizeStr, 24, "%d_%d", sf.num, sf.denom);
   else if (tilew != w || tileh != h)
-    snprintf(sizeStr, 24, "%dx%d", tilew, tileh);
-  else snprintf(sizeStr, 24, "full");
+    SNPRINTF(sizeStr, 24, "%dx%d", tilew, tileh);
+  else SNPRINTF(sizeStr, 24, "full");
   if (decompOnly)
-    snprintf(tempStr, 1024, "%s_%s.%s", fileName, sizeStr, ext);
+    SNPRINTF(tempStr, 1024, "%s_%s.%s", fileName, sizeStr, ext);
   else
-    snprintf(tempStr, 1024, "%s_%s%s_%s.%s", fileName, subName[subsamp],
+    SNPRINTF(tempStr, 1024, "%s_%s%s_%s.%s", fileName, subName[subsamp],
              qualStr, sizeStr, ext);
 
   if (tjSaveImage(tempStr, dstBuf, scaledw, 0, scaledh, pf, flags) == -1)
     THROW_TJG("saving bitmap");
   ptr = strrchr(tempStr, '.');
-  snprintf(ptr, 1024 - (ptr - tempStr), "-err.%s", ext);
+  SNPRINTF(ptr, 1024 - (ptr - tempStr), "-err.%s", ext);
   if (srcBuf && sf.num == 1 && sf.denom == 1) {
     if (!quiet) printf("Compression error written to %s.\n", tempStr);
     if (subsamp == TJ_GRAYSCALE) {
@@ -478,7 +478,7 @@
              (double)totalJpegSize * 8. / 1000000. * (double)iter / elapsed);
     }
     if (tilew == w && tileh == h && doWrite) {
-      snprintf(tempStr, 1024, "%s_%s_Q%d.jpg", fileName, subName[subsamp],
+      SNPRINTF(tempStr, 1024, "%s_%s_Q%d.jpg", fileName, subName[subsamp],
                jpegQual);
       if ((file = fopen(tempStr, "wb")) == NULL)
         THROW_UNIX("opening reference image");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/tjunittest.c 
new/libjpeg-turbo-2.1.4/tjunittest.c
--- old/libjpeg-turbo-2.1.3/tjunittest.c        2022-02-25 19:53:05.000000000 
+0100
+++ new/libjpeg-turbo-2.1.4/tjunittest.c        2022-08-08 23:03:55.000000000 
+0200
@@ -409,7 +409,7 @@
                        jpegQual, flags));
   }
 
-  snprintf(tempStr, 1024, "%s_enc_%s_%s_%s_Q%d.jpg", basename, pfStr, buStr,
+  SNPRINTF(tempStr, 1024, "%s_enc_%s_%s_%s_Q%d.jpg", basename, pfStr, buStr,
            subName[subsamp], jpegQual);
   writeJPEG(*dstBuf, *dstSize, tempStr);
   printf("Done.\n  Result in %s\n", tempStr);
@@ -782,7 +782,7 @@
     THROW("Could not allocate memory");
   initBitmap(buf, width, pitch, height, pf, flags);
 
-  snprintf(filename, 80, "test_bmp_%s_%d_%s.%s", pixFormatStr[pf], align,
+  SNPRINTF(filename, 80, "test_bmp_%s_%d_%s.%s", pixFormatStr[pf], align,
            (flags & TJFLAG_BOTTOMUP) ? "bu" : "td", ext);
   TRY_TJ(tjSaveImage(filename, buf, width, pitch, height, pf, flags));
   md5sum = MD5File(filename, md5buf);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/tjutil.h 
new/libjpeg-turbo-2.1.4/tjutil.h
--- old/libjpeg-turbo-2.1.3/tjutil.h    2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/tjutil.h    2022-08-08 23:03:55.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (C)2011 D. R. Commander.  All Rights Reserved.
+ * Copyright (C)2011, 2022 D. R. Commander.  All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -27,9 +27,20 @@
  */
 
 #ifdef _WIN32
+#ifndef strcasecmp
 #define strcasecmp  stricmp
+#endif
+#ifndef strncasecmp
 #define strncasecmp  strnicmp
 #endif
+#endif
+
+#ifdef _MSC_VER
+#define SNPRINTF(str, n, format, ...) \
+  _snprintf_s(str, n, _TRUNCATE, format, ##__VA_ARGS__)
+#else
+#define SNPRINTF  snprintf
+#endif
 
 #ifndef min
 #define min(a, b)  ((a) < (b) ? (a) : (b))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/turbojpeg-jni.c 
new/libjpeg-turbo-2.1.4/turbojpeg-jni.c
--- old/libjpeg-turbo-2.1.3/turbojpeg-jni.c     2022-02-25 19:53:05.000000000 
+0100
+++ new/libjpeg-turbo-2.1.4/turbojpeg-jni.c     2022-08-08 23:03:55.000000000 
+0200
@@ -26,8 +26,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <stdlib.h>
-#include <string.h>
 #include "turbojpeg.h"
 #include "jinclude.h"
 #include <jni.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/turbojpeg.c 
new/libjpeg-turbo-2.1.4/turbojpeg.c
--- old/libjpeg-turbo-2.1.3/turbojpeg.c 2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/turbojpeg.c 2022-08-08 23:03:55.000000000 +0200
@@ -30,8 +30,6 @@
 /* TurboJPEG/LJT:  this implements the TurboJPEG API using libjpeg or
    libjpeg-turbo */
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <ctype.h>
 #include <jinclude.h>
 #define JPEG_INTERNALS
@@ -128,9 +126,9 @@
     int scan_no = ((j_decompress_ptr)dinfo)->input_scan_number;
 
     if (scan_no > 500) {
-      snprintf(myprog->this->errStr, JMSG_LENGTH_MAX,
+      SNPRINTF(myprog->this->errStr, JMSG_LENGTH_MAX,
                "Progressive JPEG image has more than 500 scans");
-      snprintf(errStr, JMSG_LENGTH_MAX,
+      SNPRINTF(errStr, JMSG_LENGTH_MAX,
                "Progressive JPEG image has more than 500 scans");
       myprog->this->isInstanceError = TRUE;
       myerr->warning = FALSE;
@@ -193,24 +191,24 @@
 };
 
 #define THROWG(m) { \
-  snprintf(errStr, JMSG_LENGTH_MAX, "%s", m); \
+  SNPRINTF(errStr, JMSG_LENGTH_MAX, "%s", m); \
   retval = -1;  goto bailout; \
 }
 #ifdef _MSC_VER
 #define THROW_UNIX(m) { \
   char strerrorBuf[80] = { 0 }; \
   strerror_s(strerrorBuf, 80, errno); \
-  snprintf(errStr, JMSG_LENGTH_MAX, "%s\n%s", m, strerrorBuf); \
+  SNPRINTF(errStr, JMSG_LENGTH_MAX, "%s\n%s", m, strerrorBuf); \
   retval = -1;  goto bailout; \
 }
 #else
 #define THROW_UNIX(m) { \
-  snprintf(errStr, JMSG_LENGTH_MAX, "%s\n%s", m, strerror(errno)); \
+  SNPRINTF(errStr, JMSG_LENGTH_MAX, "%s\n%s", m, strerror(errno)); \
   retval = -1;  goto bailout; \
 }
 #endif
 #define THROW(m) { \
-  snprintf(this->errStr, JMSG_LENGTH_MAX, "%s", m); \
+  SNPRINTF(this->errStr, JMSG_LENGTH_MAX, "%s", m); \
   this->isInstanceError = TRUE;  THROWG(m) \
 }
 
@@ -225,7 +223,7 @@
   j_decompress_ptr dinfo = NULL; \
   \
   if (!this) { \
-    snprintf(errStr, JMSG_LENGTH_MAX, "Invalid handle"); \
+    SNPRINTF(errStr, JMSG_LENGTH_MAX, "Invalid handle"); \
     return -1; \
   } \
   cinfo = &this->cinfo;  dinfo = &this->dinfo; \
@@ -237,7 +235,7 @@
   j_compress_ptr cinfo = NULL; \
   \
   if (!this) { \
-    snprintf(errStr, JMSG_LENGTH_MAX, "Invalid handle"); \
+    SNPRINTF(errStr, JMSG_LENGTH_MAX, "Invalid handle"); \
     return -1; \
   } \
   cinfo = &this->cinfo; \
@@ -249,7 +247,7 @@
   j_decompress_ptr dinfo = NULL; \
   \
   if (!this) { \
-    snprintf(errStr, JMSG_LENGTH_MAX, "Invalid handle"); \
+    SNPRINTF(errStr, JMSG_LENGTH_MAX, "Invalid handle"); \
     return -1; \
   } \
   dinfo = &this->dinfo; \
@@ -521,12 +519,12 @@
   tjinstance *this = NULL;
 
   if ((this = (tjinstance *)malloc(sizeof(tjinstance))) == NULL) {
-    snprintf(errStr, JMSG_LENGTH_MAX,
+    SNPRINTF(errStr, JMSG_LENGTH_MAX,
              "tjInitCompress(): Memory allocation failure");
     return NULL;
   }
   memset(this, 0, sizeof(tjinstance));
-  snprintf(this->errStr, JMSG_LENGTH_MAX, "No error");
+  SNPRINTF(this->errStr, JMSG_LENGTH_MAX, "No error");
   return _tjInitCompress(this);
 }
 
@@ -1195,12 +1193,12 @@
   tjinstance *this;
 
   if ((this = (tjinstance *)malloc(sizeof(tjinstance))) == NULL) {
-    snprintf(errStr, JMSG_LENGTH_MAX,
+    SNPRINTF(errStr, JMSG_LENGTH_MAX,
              "tjInitDecompress(): Memory allocation failure");
     return NULL;
   }
   memset(this, 0, sizeof(tjinstance));
-  snprintf(this->errStr, JMSG_LENGTH_MAX, "No error");
+  SNPRINTF(this->errStr, JMSG_LENGTH_MAX, "No error");
   return _tjInitDecompress(this);
 }
 
@@ -1227,7 +1225,13 @@
   }
 
   jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);
-  jpeg_read_header(dinfo, TRUE);
+
+  /* jpeg_read_header() calls jpeg_abort() and returns JPEG_HEADER_TABLES_ONLY
+     if the datastream is a tables-only datastream.  Since we aren't using a
+     suspending data source, the only other value it can return is
+     JPEG_HEADER_OK. */
+  if (jpeg_read_header(dinfo, FALSE) == JPEG_HEADER_TABLES_ONLY)
+    return 0;
 
   *width = dinfo->image_width;
   *height = dinfo->image_height;
@@ -1279,7 +1283,7 @@
 DLLEXPORT tjscalingfactor *tjGetScalingFactors(int *numscalingfactors)
 {
   if (numscalingfactors == NULL) {
-    snprintf(errStr, JMSG_LENGTH_MAX,
+    SNPRINTF(errStr, JMSG_LENGTH_MAX,
              "tjGetScalingFactors(): Invalid argument");
     return NULL;
   }
@@ -1886,12 +1890,12 @@
   tjhandle handle = NULL;
 
   if ((this = (tjinstance *)malloc(sizeof(tjinstance))) == NULL) {
-    snprintf(errStr, JMSG_LENGTH_MAX,
+    SNPRINTF(errStr, JMSG_LENGTH_MAX,
              "tjInitTransform(): Memory allocation failure");
     return NULL;
   }
   memset(this, 0, sizeof(tjinstance));
-  snprintf(this->errStr, JMSG_LENGTH_MAX, "No error");
+  SNPRINTF(this->errStr, JMSG_LENGTH_MAX, "No error");
   handle = _tjInitCompress(this);
   if (!handle) return NULL;
   handle = _tjInitDecompress(this);
@@ -1982,7 +1986,7 @@
     if (xinfo[i].crop) {
       if ((t[i].r.x % tjMCUWidth[jpegSubsamp]) != 0 ||
           (t[i].r.y % tjMCUHeight[jpegSubsamp]) != 0) {
-        snprintf(this->errStr, JMSG_LENGTH_MAX,
+        SNPRINTF(this->errStr, JMSG_LENGTH_MAX,
                  "To crop this JPEG image, x must be a multiple of %d\n"
                  "and y must be a multiple of %d.\n",
                  tjMCUWidth[jpegSubsamp], tjMCUHeight[jpegSubsamp]);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/turbojpeg.h 
new/libjpeg-turbo-2.1.4/turbojpeg.h
--- old/libjpeg-turbo-2.1.3/turbojpeg.h 2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/turbojpeg.h 2022-08-08 23:03:55.000000000 +0200
@@ -1129,27 +1129,38 @@
 
 
 /**
- * Retrieve information about a JPEG image without decompressing it.
+ * Retrieve information about a JPEG image without decompressing it, or prime
+ * the decompressor with quantization and Huffman tables.
  *
  * @param handle a handle to a TurboJPEG decompressor or transformer instance
  *
- * @param jpegBuf pointer to a buffer containing a JPEG image
+ * @param jpegBuf pointer to a buffer containing a JPEG image or an
+ * "abbreviated table specification" (AKA "tables-only") datastream.  Passing a
+ * tables-only datastream to this function primes the decompressor with
+ * quantization and Huffman tables that can be used when decompressing
+ * subsequent "abbreviated image" datastreams.  This is useful, for instance,
+ * when decompressing video streams in which all frames share the same
+ * quantization and Huffman tables.
  *
- * @param jpegSize size of the JPEG image (in bytes)
+ * @param jpegSize size of the JPEG image or tables-only datastream (in bytes)
  *
  * @param width pointer to an integer variable that will receive the width (in
- * pixels) of the JPEG image
+ * pixels) of the JPEG image.  If <tt>jpegBuf</tt> points to a tables-only
+ * datastream, then <tt>width</tt> is ignored.
  *
  * @param height pointer to an integer variable that will receive the height
- * (in pixels) of the JPEG image
+ * (in pixels) of the JPEG image.  If <tt>jpegBuf</tt> points to a tables-only
+ * datastream, then <tt>height</tt> is ignored.
  *
  * @param jpegSubsamp pointer to an integer variable that will receive the
  * level of chrominance subsampling used when the JPEG image was compressed
- * (see @ref TJSAMP "Chrominance subsampling options".)
+ * (see @ref TJSAMP "Chrominance subsampling options".)  If <tt>jpegBuf</tt>
+ * points to a tables-only datastream, then <tt>jpegSubsamp</tt> is ignored.
  *
  * @param jpegColorspace pointer to an integer variable that will receive one
  * of the JPEG colorspace constants, indicating the colorspace of the JPEG
- * image (see @ref TJCS "JPEG colorspaces".)
+ * image (see @ref TJCS "JPEG colorspaces".)  If <tt>jpegBuf</tt>
+ * points to a tables-only datastream, then <tt>jpegColorspace</tt> is ignored.
  *
  * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2()
  * and #tjGetErrorCode().)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/usage.txt 
new/libjpeg-turbo-2.1.4/usage.txt
--- old/libjpeg-turbo-2.1.3/usage.txt   2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/usage.txt   2022-08-08 23:03:55.000000000 +0200
@@ -25,7 +25,7 @@
 We provide two programs, cjpeg to compress an image file into JPEG format,
 and djpeg to decompress a JPEG file back into a conventional image format.
 
-On Unix-like systems, you say:
+On most systems, you say:
         cjpeg [switches] [imagefile] >jpegfile
 or
         djpeg [switches] [jpegfile]  >imagefile
@@ -34,19 +34,19 @@
 standard error).  These conventions are handy for piping images between
 programs.
 
-On most non-Unix systems, you say:
+If you defined TWO_FILE_COMMANDLINE when compiling the programs, you can
+instead say:
         cjpeg [switches] imagefile jpegfile
 or
         djpeg [switches] jpegfile  imagefile
 i.e., both the input and output files are named on the command line.  This
 style is a little more foolproof, and it loses no functionality if you don't
-have pipes.  (You can get this style on Unix too, if you prefer, by defining
-TWO_FILE_COMMANDLINE when you compile the programs; see install.txt.)
+have pipes.
 
 You can also say:
         cjpeg [switches] -outfile jpegfile  imagefile
 or
-        djpeg [switches] -outfile imagefile  jpegfile
+        djpeg [switches] -outfile imagefile jpegfile
 This syntax works on all systems, so it is useful for scripts.
 
 The currently supported image file formats are: PPM (PBMPLUS color format),
@@ -143,8 +143,8 @@
 assigned to components with the -qslots option (see the "wizard" switches
 below.)
 
-JPEG  files  generated  with separate luminance and chrominance quality are
-fully compliant with standard JPEG decoders.
+JPEG files generated with separate luminance and chrominance quality are fully
+compliant with standard JPEG decoders.
 
 CAUTION: For this setting to be useful, be sure to pass an argument of
 -sample 1x1 to cjpeg to disable chrominance subsampling.  Otherwise, the
@@ -218,7 +218,7 @@
                         space is needed, an error will occur.
 
         -verbose        Enable debug printout.  More -v's give more printout.
-        or  -debug      Also, version information is printed at startup.
+        or -debug       Also, version information is printed at startup.
 
 The -restart option inserts extra markers that allow a JPEG decoder to
 resynchronize after a transmission error.  Without restart markers, any damage
@@ -467,9 +467,10 @@
 can be removed.  See the -copy option for specifics.
 
 jpegtran uses a command line syntax similar to cjpeg or djpeg.
-On Unix-like systems, you say:
+On most systems, you say:
         jpegtran [switches] [inputfile] >outputfile
-On most non-Unix systems, you say:
+If you defined TWO_FILE_COMMANDLINE when compiling the program, you can instead
+say:
         jpegtran [switches] inputfile outputfile
 where both the input and output files are JPEG files.
 
@@ -649,13 +650,13 @@
 file by directing wrjpgcom's output back into it; on most systems this will
 just destroy your file.
 
-The command line syntax for wrjpgcom is similar to cjpeg's.  On Unix-like
-systems, it is
+The command line syntax for wrjpgcom is similar to cjpeg's.  On most systems,
+it is
         wrjpgcom [switches] [inputfilename]
 The output file is written to standard output.  The input file comes from
 the named file, or from standard input if no input file is named.
 
-On most non-Unix systems, the syntax is
+If you defined TWO_FILE_COMMANDLINE when compiling the program, the syntax is:
         wrjpgcom [switches] inputfilename outputfilename
 where both input and output file names must be given explicitly.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libjpeg-turbo-2.1.3/wrjpgcom.c 
new/libjpeg-turbo-2.1.4/wrjpgcom.c
--- old/libjpeg-turbo-2.1.3/wrjpgcom.c  2022-02-25 19:53:05.000000000 +0100
+++ new/libjpeg-turbo-2.1.4/wrjpgcom.c  2022-08-08 23:03:55.000000000 +0200
@@ -28,16 +28,6 @@
 #include <io.h>                 /* to declare setmode() */
 #endif
 
-#ifdef USE_CCOMMAND             /* command-line reader for Macintosh */
-#ifdef __MWERKS__
-#include <SIOUX.h>              /* Metrowerks needs this */
-#include <console.h>            /* ... and this */
-#endif
-#ifdef THINK_C
-#include <console.h>            /* Think declares it here */
-#endif
-#endif
-
 #ifdef DONT_USE_B_MODE          /* define mode parameters for fopen() */
 #define READ_BINARY     "r"
 #define WRITE_BINARY    "w"
@@ -415,11 +405,6 @@
   unsigned int comment_length = 0;
   int marker;
 
-  /* On Mac, fetch a command line. */
-#ifdef USE_CCOMMAND
-  argc = ccommand(&argv);
-#endif
-
   progname = argv[0];
   if (progname == NULL || progname[0] == 0)
     progname = "wrjpgcom";      /* in case C library doesn't provide it */

Reply via email to