Updated to release 2.0.0, rediffed P1 and added P2 to fix library path, fixed file lists

This commit is contained in:
Giovanni Mariani 2018-08-01 16:27:39 +02:00
parent ff8aca6fe3
commit d96ac9ad59
5 changed files with 73 additions and 69 deletions

View file

@ -1,2 +1,2 @@
sources:
libjpeg-turbo-1.5.3.tar.gz: 87ebf4cab2bb27fcb8e7ccb18ec4eb680e1f2c2d
libjpeg-turbo-2.0.0.tar.gz: fe49aea935617748c21ecbe46c986d6c1b98f39b

View file

@ -1,53 +0,0 @@
From 1ecd9a5729d78518397889a630e3534bd9d963a8 Mon Sep 17 00:00:00 2001
From: Kornel <kornel@geekhood.net>
Date: Sat, 30 Sep 2017 12:05:53 +0100
Subject: [PATCH] Handle NULL buffer when discarding rows
---
jdpostct.c | 5 +++++
jquant1.c | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/jdpostct.c b/jdpostct.c
index 601fc2a79..a24202ca9 100644
--- a/jdpostct.c
+++ b/jdpostct.c
@@ -132,6 +132,11 @@ post_process_1pass (j_decompress_ptr cinfo,
my_post_ptr post = (my_post_ptr) cinfo->post;
JDIMENSION num_rows, max_rows;
+ /* read_and_discard_scanlines may call it with rows "available", but no buffer */
+ if (output_buf == NULL) {
+ return;
+ }
+
/* Fill the buffer, but not more than what we can dump out in one go. */
/* Note we rely on the upsampler to detect bottom of image. */
max_rows = out_rows_avail - *out_row_ctr;
diff --git a/jquant1.c b/jquant1.c
index e7814815e..ba2ea9b80 100644
--- a/jquant1.c
+++ b/jquant1.c
@@ -531,6 +531,10 @@ quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION col;
JDIMENSION width = cinfo->output_width;
+ if (output_buf == NULL && num_rows) {
+ ERREXIT(cinfo, JERR_BAD_PARAM);
+ }
+
for (row = 0; row < num_rows; row++) {
/* Initialize output values to 0 so can process components separately */
jzero_far((void *) output_buf[row], (size_t) (width * sizeof(JSAMPLE)));
Index: libjpeg-turbo-1.5.2/jerror.h
===================================================================
--- libjpeg-turbo-1.5.2.orig/jerror.h 2017-07-07 22:31:10.000000000 +0200
+++ libjpeg-turbo-1.5.2/jerror.h 2017-10-12 13:24:01.349954012 +0200
@@ -208,6 +208,7 @@ JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmeti
JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
#endif
#endif
+JMESSAGE(JERR_BAD_PARAM, "Bogus parameter")
#ifdef JMAKE_ENUM_LIST

View file

@ -0,0 +1,40 @@
diff -rupN libjpeg-turbo-2.0.0.old/jdpostct.c libjpeg-turbo-2.0.0/jdpostct.c
--- libjpeg-turbo-2.0.0.old/jdpostct.c 2018-07-27 18:47:48.000000000 +0200
+++ libjpeg-turbo-2.0.0/jdpostct.c 2018-08-01 16:10:01.647692751 +0200
@@ -137,6 +137,11 @@ post_process_1pass(j_decompress_ptr cinf
my_post_ptr post = (my_post_ptr)cinfo->post;
JDIMENSION num_rows, max_rows;
+ /* read_and_discard_scanlines may call it with rows "available", but no buffer */
+ if (output_buf == NULL) {
+ return;
+ }
+
/* Fill the buffer, but not more than what we can dump out in one go. */
/* Note we rely on the upsampler to detect bottom of image. */
max_rows = out_rows_avail - *out_row_ctr;
diff -rupN libjpeg-turbo-2.0.0.old/jerror.h libjpeg-turbo-2.0.0/jerror.h
--- libjpeg-turbo-2.0.0.old/jerror.h 2018-07-27 18:47:48.000000000 +0200
+++ libjpeg-turbo-2.0.0/jerror.h 2018-08-01 16:11:31.554054434 +0200
@@ -207,6 +207,7 @@ JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt J
#endif
#endif
JMESSAGE(JWRN_BOGUS_ICC, "Corrupt JPEG data: bad ICC marker")
+JMESSAGE(JERR_BAD_PARAM, "Bogus parameter")
#ifdef JMAKE_ENUM_LIST
diff -rupN libjpeg-turbo-2.0.0.old/jquant1.c libjpeg-turbo-2.0.0/jquant1.c
--- libjpeg-turbo-2.0.0.old/jquant1.c 2018-07-27 18:47:48.000000000 +0200
+++ libjpeg-turbo-2.0.0/jquant1.c 2018-08-01 16:12:44.437913930 +0200
@@ -532,6 +532,10 @@ quantize_ord_dither(j_decompress_ptr cin
JDIMENSION col;
JDIMENSION width = cinfo->output_width;
+ if (output_buf == NULL && num_rows) {
+ ERREXIT(cinfo, JERR_BAD_PARAM);
+ }
+
for (row = 0; row < num_rows; row++) {
/* Initialize output values to 0 so can process components separately */
jzero_far((void *)output_buf[row], (size_t)(width * sizeof(JSAMPLE)));

View file

@ -0,0 +1,12 @@
diff -rupN libjpeg-turbo-2.0.0.old/CMakeLists.txt libjpeg-turbo-2.0.0/CMakeLists.txt
--- libjpeg-turbo-2.0.0.old/CMakeLists.txt 2018-07-27 18:47:48.000000000 +0200
+++ libjpeg-turbo-2.0.0/CMakeLists.txt 2018-08-01 16:24:47.625312813 +0200
@@ -102,7 +102,7 @@ if(CMAKE_INSTALL_PREFIX STREQUAL "${CMAK
if(BITS EQUAL 64)
set(CMAKE_INSTALL_DEFAULT_LIBDIR "lib64")
else()
- set(CMAKE_INSTALL_DEFAULT_LIBDIR "lib32")
+ set(CMAKE_INSTALL_DEFAULT_LIBDIR "lib")
endif()
endif()
endif()

View file

@ -12,7 +12,7 @@
Summary: A MMX/SSE2 accelerated library for manipulating JPEG image files
Name: libjpeg-turbo
Epoch: 1
Version: 1.5.3
Version: 2.0.0
Release: 1
License: wxWindows Library License
Group: System/Libraries
@ -25,7 +25,9 @@ Source0: https://sourceforge.net/projects/libjpeg-turbo/files/%{version}/%{name}
Source2: http://jpegclub.org/jpegexiforient.c
Source3: http://jpegclub.org/exifautotran.txt
Patch0: jpeg-6b-c++fixes.patch
Patch1: %{name}-1.5.2-CVE-2017-15232.patch
Patch1: %{name}-2.0.0-CVE-2017-15232.patch
Patch2: %{name}-2.0.0-fix-lib-path.patch
BuildRequires: cmake
BuildRequires: libtool >= 1.4
%ifarch %{ix86} x86_64
BuildRequires: nasm
@ -99,7 +101,7 @@ developing programs which will manipulate JPEG files using the libjpeg
library.
%files -n %{devname}
%doc coderules.txt example.c jconfig.txt libjpeg.txt structure.txt
%doc coderules.txt jconfig.txt libjpeg.txt structure.txt
%{_libdir}/libjpeg.so
%{_libdir}/libturbojpeg.so
%{_includedir}/*.h
@ -159,39 +161,42 @@ have orientation markings in the EXIF data.
%setup -q
%patch0 -p0
%patch1 -p1
%patch2 -p1
cp %{SOURCE2} jpegexiforient.c
cp %{SOURCE3} exifautotran
%build
CONFIGURE_TOP="$PWD"
# Prepare build dirs
mkdir -p jpeg8
mkdir -p jpeg62
# Build jpeg v8 API
pushd jpeg8
CFLAGS="%{optflags} -Ofast -funroll-loops" \
%configure2_5x \
--enable-shared \
--enable-static \
--with-jpeg8
%cmake ../.. -DWITH_JPEG8="True"
%make
popd
mkdir -p jpeg62
# Build jpeg v6.2 API
pushd jpeg62
CFLAGS="%{optflags} -Ofast -funroll-loops" \
%configure2_5x \
--enable-shared \
--disable-static
%cmake ../.. \
-DWITH_ARITH_DEC="True" \
-DWITH_ARITH_ENC="True"
%make
popd
# Build jpegexiforient binary
%__cc %{optflags} %{ldflags} -o jpegexiforient jpegexiforient.c
%install
make install-libLTLIBRARIES DESTDIR=%{buildroot} -C jpeg62
%makeinstall_std -C jpeg8
%makeinstall_std -C jpeg8/build
%makeinstall_std -C jpeg62/build
install -m755 jpegexiforient -D %{buildroot}%{_bindir}/jpegexiforient
install -m755 exifautotran -D %{buildroot}%{_bindir}/exifautotran