Accepting request 626889 from home:scarabeus_iv:branches:graphics

- Version update to 2.0.0:
  * Cmake as a buildsystem
  * avx support
  * Better error handling
  * More use of SSE2
- Drop patch libjpeg-1.4.0-ocloexec.patch; conflicts, would be better
  handled by upstream anyway
- Drop patches merged upstream:
  * libjpeg-turbo-CVE-2018-11813.patch
  * libjpeg-turbo-CVE-2018-1152.patch

- Version update to 2.0.0:
  * Cmake as a buildsystem
  * avx support
  * Better error handling
  * More use of SSE2
- Drop patch libjpeg-1.4.0-ocloexec.patch; conflicts, would be better
  handled by upstream anyway
- Drop patches merged upstream:
  * libjpeg-turbo-CVE-2018-11813.patch
  * libjpeg-turbo-CVE-2018-1152.patch

OBS-URL: https://build.opensuse.org/request/show/626889
OBS-URL: https://build.opensuse.org/package/show/graphics/libjpeg-turbo?expand=0&rev=79
This commit is contained in:
Petr Gajdos 2018-08-01 12:49:51 +00:00 committed by Git OBS Bridge
parent 0f877d8991
commit 70d2b5c6bc
9 changed files with 65 additions and 231 deletions

View File

@ -1,96 +0,0 @@
This patch causes libjpeg to open all files with O_CLOEXEC
the "e" fopen mode is a glibc/linux specific feature hence
not suitable for other OS.
Note that it is NOT HANDLED GRACEFULLY on kernels older than
2.6.23 or glibc < 2.7.x and WILL segfault.
The other alternative, using fcntl with FD_CLOEXEC is NOT
enough to prevent race conditions.
--- wrjpgcom.c.orig
+++ wrjpgcom.c
@@ -37,11 +37,11 @@
#endif
#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
-#define READ_BINARY "r"
-#define WRITE_BINARY "w"
+#define READ_BINARY "re"
+#define WRITE_BINARY "we"
#else
-#define READ_BINARY "rb"
-#define WRITE_BINARY "wb"
+#define READ_BINARY "rbe"
+#define WRITE_BINARY "wbe"
#endif
#ifndef EXIT_FAILURE /* define exit() codes if not provided */
@@ -432,7 +432,7 @@
keep_COM = 0;
} else if (keymatch(arg, "cfile", 2)) {
if (++argn >= argc) usage();
- if ((comment_file = fopen(argv[argn], "r")) == NULL) {
+ if ((comment_file = fopen(argv[argn], READ_BINARY)) == NULL) {
fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
exit(EXIT_FAILURE);
}
--- cdjpeg.h.orig
+++ cdjpeg.h
@@ -126,11 +126,11 @@
/* miscellaneous useful macros */
#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */
-#define READ_BINARY "r"
-#define WRITE_BINARY "w"
+#define READ_BINARY "re"
+#define WRITE_BINARY "we"
#else
-#define READ_BINARY "rb"
-#define WRITE_BINARY "wb"
+#define READ_BINARY "rbe"
+#define WRITE_BINARY "wbe"
#endif
#ifndef EXIT_FAILURE /* define exit() codes if not provided */
--- rdswitch.c.orig
+++ rdswitch.c
@@ -93,7 +93,7 @@
long val;
unsigned int table[DCTSIZE2];
- if ((fp = fopen(filename, "r")) == NULL) {
+ if ((fp = fopen(filename, READ_BINARY)) == NULL) {
fprintf(stderr, "Can't open table file %s\n", filename);
return FALSE;
}
@@ -191,7 +191,7 @@
#define MAX_SCANS 100 /* quite arbitrary limit */
jpeg_scan_info scans[MAX_SCANS];
- if ((fp = fopen(filename, "r")) == NULL) {
+ if ((fp = fopen(filename, READ_BINARY)) == NULL) {
fprintf(stderr, "Can't open scan definition file %s\n", filename);
return FALSE;
}
--- bmp.c.orig
+++ bmp.c
@@ -112,7 +112,7 @@ int loadbmp(char *filename, unsigned cha
if(!filename || !buf || !w || !h || dstpf<0 || dstpf>=TJ_NUMPF)
_throw("loadbmp(): Invalid argument");
- if((file=fopen(filename, "rb"))==NULL)
+ if((file=fopen(filename, READ_BINARY))==NULL)
_throwunix("loadbmp(): Cannot open input file");
cinfo.err=jpeg_std_error(&jerr.pub);
@@ -196,7 +196,7 @@ int savebmp(char *filename, unsigned cha
if(!filename || !buf || w<1 || h<1 || srcpf<0 || srcpf>=TJ_NUMPF)
_throw("savebmp(): Invalid argument");
- if((file=fopen(filename, "wb"))==NULL)
+ if((file=fopen(filename, WRITE_BINARY))==NULL)
_throwunix("savebmp(): Cannot open output file");
dinfo.err=jpeg_std_error(&jerr.pub);

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b24890e2bb46e12e72a79f7e965f409f4e16466d00e1dd15d93d73ee6b592523
size 1658672

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:778876105d0d316203c928fd2a0374c8c01f755d0a00b12a1c8934aeccff8868
size 2158457

View File

@ -1,17 +0,0 @@
Index: libjpeg-turbo-1.5.3/rdbmp.c
===================================================================
--- libjpeg-turbo-1.5.3.orig/rdbmp.c
+++ libjpeg-turbo-1.5.3/rdbmp.c
@@ -434,6 +434,12 @@ start_input_bmp (j_compress_ptr cinfo, c
progress->total_extra_passes++; /* count file input as separate pass */
}
+ /* Ensure that biWidth * cinfo->input_components doesn't exceed the maximum
+ value of the JDIMENSION type. This is only a danger with BMP files, since
+ their width and height fields are 32-bit integers. */
+ if ((unsigned long long)biWidth *
+ (unsigned long long)cinfo->input_components > 0xFFFFFFFFULL)
+ ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
/* Allocate one-row buffer for returned data */
source->pub.buffer = (*cinfo->mem->alloc_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE,

View File

@ -1,34 +0,0 @@
Index: libjpeg-turbo-1.5.3/rdtarga.c
===================================================================
--- libjpeg-turbo-1.5.3.orig/rdtarga.c 2017-12-14 05:39:01.000000000 +0100
+++ libjpeg-turbo-1.5.3/rdtarga.c 2018-06-13 09:32:33.927652164 +0200
@@ -125,11 +125,10 @@ METHODDEF(void)
read_non_rle_pixel (tga_source_ptr sinfo)
/* Read one Targa pixel from the input file; no RLE expansion */
{
- register FILE *infile = sinfo->pub.input_file;
register int i;
for (i = 0; i < sinfo->pixel_size; i++) {
- sinfo->tga_pixel[i] = (U_CHAR) getc(infile);
+ sinfo->tga_pixel[i] = (U_CHAR)read_byte(sinfo);
}
}
@@ -138,7 +137,6 @@ METHODDEF(void)
read_rle_pixel (tga_source_ptr sinfo)
/* Read one Targa pixel from the input file, expanding RLE data as needed */
{
- register FILE *infile = sinfo->pub.input_file;
register int i;
/* Duplicate previously read pixel? */
@@ -160,7 +158,7 @@ read_rle_pixel (tga_source_ptr sinfo)
/* Read next pixel */
for (i = 0; i < sinfo->pixel_size; i++) {
- sinfo->tga_pixel[i] = (U_CHAR) getc(infile);
+ sinfo->tga_pixel[i] = (U_CHAR)read_byte(sinfo);
}
}

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Wed Aug 1 11:39:01 UTC 2018 - tchvatal@suse.com
- Version update to 2.0.0:
* Cmake as a buildsystem
* avx support
* Better error handling
* More use of SSE2
- Drop patch libjpeg-1.4.0-ocloexec.patch; conflicts, would be better
handled by upstream anyway
- Drop patches merged upstream:
* libjpeg-turbo-CVE-2018-11813.patch
* libjpeg-turbo-CVE-2018-1152.patch
-------------------------------------------------------------------
Tue Jun 19 13:40:32 UTC 2018 - pgajdos@suse.com

View File

@ -16,40 +16,35 @@
#
%define srcver 1.5.3
%define srcver 2.0.0
%define major 8
%define minor 1
%define minor 2
%define micro 2
%define libver %{major}.%{minor}.%{micro}
%define tmajor 0
%define tminor 1
%define tminor 2
%define tmicro 0
%define tlibver %{tmajor}.%{tminor}.%{tmicro}
Name: libjpeg-turbo
Version: %{srcver}
Release: 0
Summary: A MMX/SSE2 accelerated library for manipulating JPEG image files
License: BSD-3-Clause
Group: Productivity/Graphics/Convertors
Url: http://sourceforge.net/projects/libjpeg-turbo
URL: https://github.com/libjpeg-turbo/libjpeg-turbo
Source0: http://downloads.sf.net/libjpeg-turbo/libjpeg-turbo-%{version}.tar.gz
Source1: baselibs.conf
Patch1: libjpeg-turbo-1.3.0-tiff-ojpeg.patch
Patch2: libjpeg-1.4.0-ocloexec.patch
Patch3: libjpeg-turbo-CVE-2018-11813.patch
Patch4: libjpeg-turbo-CVE-2018-1152.patch
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: yasm
Conflicts: jpeg%{major}
Obsoletes: jpeg = 6b
Obsoletes: jpeg = 8.0.1
Obsoletes: jpeg = 8.0.2
Provides: jpeg = %{version}
Obsoletes: jpeg < %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Conflicts: jpeg%{major}
%description
The libjpeg-turbo package contains a library of functions for manipulating
@ -58,18 +53,13 @@ JPEG images. It also includes the following command line utilities:
jpegtran - lossless transformation of JPEG files
rdjpgcom - display text comments from a JPEG file
wrjpgcom - insert text comments into a JPEG file
tjbench - a JPEG decompression/compression benchmark
tjbench - a JPEG decompression/compression benchmark
%package -n libjpeg%{major}
Version: %{libver}
Release: 0
Summary: The MMX/SSE accelerated JPEG compression/decompression library
# bug437293
Group: System/Libraries
%ifarch ppc64
Obsoletes: libjpeg-64bit < %{version}
%endif
#
%description -n libjpeg%{major}
This library contains MMX/SSE accelerated functions for manipulating
@ -92,14 +82,9 @@ Summary: Development Tools for applications which will use the Libjpeg Li
Group: Development/Libraries/C and C++
Requires: libjpeg%{major} = %{version}
Requires: libturbojpeg%{tmajor} = %{version}
Conflicts: libjpeg-devel
Provides: libjpeg-devel = %{version}
Obsoletes: libjpeg-devel < %{version}
Conflicts: otherproviders(libjpeg-devel)
# bug437293
%ifarch ppc64
Obsoletes: libjpeg-devel-64bit < %{version}
%endif
#
%description -n libjpeg%{major}-devel
The libjpeg-devel package includes the header files and libraries
@ -107,61 +92,52 @@ necessary for compiling and linking programs which will manipulate JPEG
files using the libjpeg library.
%prep
%setup -q
%setup -q
%patch1
%patch2
%patch3 -p1
%patch4 -p1
%build
export LDFLAGS="-Wl,-z,relro,-z,now"
%configure --disable-static \
--with-build-date=$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y%m%d) \
--with-jpeg8
%cmake \
-DENABLE_STATIC=OFF \
-DWITH_JPEG8=ON
make %{?_smp_mflags}
%check
make test libdir=%{_libdir}
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
%ctest
%install
%make_install
# Remove unwanted files
rm -f %{buildroot}%{_libdir}/lib{,turbo}jpeg.la
%cmake_install
# Remove docs, we'll select docs manually
rm -rf %{buildroot}%{_datadir}/doc/
%post -n libjpeg%{major} -p /sbin/ldconfig
%postun -n libjpeg%{major} -p /sbin/ldconfig
%post -n libturbojpeg%{tmajor} -p /sbin/ldconfig
%postun -n libturbojpeg%{tmajor} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc README.md change.log ChangeLog.md
%doc usage.txt wizard.txt
%{_bindir}/*
%doc %{_mandir}/man1/*
%{_mandir}/man1/*
%files -n libjpeg%{major}
%defattr(-,root,root)
%license LICENSE.md
%{_libdir}/libjpeg.so.%{libver}
%{_libdir}/libjpeg.so.%{major}
%files -n libturbojpeg%{tmajor}
%defattr(-,root,root)
%license LICENSE.md
%{_libdir}/libturbojpeg.so.%{tmajor}
%{_libdir}/libturbojpeg.so.%{tlibver}
%files -n libjpeg%{major}-devel
%defattr(-,root,root)
%{_includedir}/*.h
%{_libdir}/libjpeg.so
%{_libdir}/libturbojpeg.so
%{_libdir}/pkgconfig/libjpeg.pc
%{_libdir}/pkgconfig/libturbojpeg.pc
%doc coderules.txt jconfig.txt libjpeg.txt structure.txt example.c
%doc coderules.txt jconfig.txt libjpeg.txt structure.txt tjexample.c
%changelog

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Wed Aug 1 11:39:01 UTC 2018 - tchvatal@suse.com
- Version update to 2.0.0:
* Cmake as a buildsystem
* avx support
* Better error handling
* More use of SSE2
- Drop patch libjpeg-1.4.0-ocloexec.patch; conflicts, would be better
handled by upstream anyway
- Drop patches merged upstream:
* libjpeg-turbo-CVE-2018-11813.patch
* libjpeg-turbo-CVE-2018-1152.patch
-------------------------------------------------------------------
Tue Jun 19 13:45:31 UTC 2018 - pgajdos@suse.com

View File

@ -17,29 +17,26 @@
%define major 62
%define minor 2
%define minor 3
%define micro 0
%define srcver 1.5.3
%define srcver 2.0.0
%define libver %{major}.%{minor}.%{micro}
Name: libjpeg62-turbo
Version: %{srcver}
Release: 0
Summary: A MMX/SSE2 accelerated library for manipulating JPEG image files
License: BSD-3-Clause
Group: Productivity/Graphics/Convertors
Url: http://sourceforge.net/projects/libjpeg-turbo
URL: http://sourceforge.net/projects/libjpeg-turbo
Source0: http://downloads.sf.net/libjpeg-turbo/libjpeg-turbo-%{version}.tar.gz
Source1: baselibs.conf
Patch1: libjpeg-turbo-1.3.0-tiff-ojpeg.patch
Patch2: libjpeg-1.4.0-ocloexec.patch
Patch3: libjpeg-turbo-CVE-2018-11813.patch
Patch4: libjpeg-turbo-CVE-2018-1152.patch
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: libtool
# needed for tests as we remove the lib here
BuildRequires: libturbojpeg0 >= 8.2.2
BuildRequires: pkgconfig
BuildRequires: yasm
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Conflicts: jpeg%{major}
%description
@ -52,11 +49,6 @@ Release: 0
Summary: The MMX/SSE accelerated JPEG compression/decompression library
Group: System/Libraries
Obsoletes: libjpeg = 6.2.0
# bug437293
%ifarch ppc64
Obsoletes: libjpeg-64bit < %{version}
%endif
#
%description -n libjpeg%{major}
This library contains MMX/SSE accelerated functions for manipulating
@ -68,14 +60,9 @@ Release: 0
Summary: Development Tools for applications which will use the Libjpeg Library
Group: Development/Libraries/C and C++
Requires: libjpeg%{major} = %{version}
Conflicts: libjpeg-devel
Provides: libjpeg-devel = %{version}
Obsoletes: libjpeg-devel < %{version}
Conflicts: otherproviders(libjpeg-devel)
# bug437293
%ifarch ppc64
Obsoletes: libjpeg-devel-64bit < %{version}
%endif
#
%description -n libjpeg%{major}-devel
The libjpeg-devel package includes the header files and libraries
@ -85,51 +72,41 @@ files using the libjpeg library.
%prep
%setup -q -n libjpeg-turbo-%{srcver}
%patch1
%patch2
%patch3 -p1
%patch4 -p1
%build
export LDFLAGS="-Wl,-z,relro,-z,now"
%configure --disable-static \
--with-build-date=$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y%m%d)
%cmake \
-DENABLE_STATIC=OFF
make %{?_smp_mflags}
%check
make test libdir=%{_libdir}
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
%ctest
%install
%make_install
%cmake_install
# Remove unwanted files
rm -f %{buildroot}%{_libdir}/lib{,turbo}jpeg.la
rm %{buildroot}%{_bindir}/*
rm %{buildroot}%{_mandir}/man1/*
# libjpegturbo is provided with libjpeg-turbo.spec yet
rm %{buildroot}%{_includedir}/turbojpeg.h
rm %{buildroot}%{_libdir}/libturbojpeg.so*
rm %{buildroot}%{_libdir}/pkgconfig/libturbojpeg.pc
# Remove docs, we'll select docs manually
rm -rf %{buildroot}%{_datadir}/doc/
%post -n libjpeg%{major} -p /sbin/ldconfig
%postun -n libjpeg%{major} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc README.md change.log ChangeLog.md
%doc usage.txt wizard.txt
%files -n libjpeg%{major}
%defattr(-,root,root)
%license LICENSE.md
%{_libdir}/libjpeg.so.%{major}
%{_libdir}/libjpeg.so.%{libver}
%files -n libjpeg%{major}-devel
%defattr(-,root,root)
%{_includedir}/*.h
%{_libdir}/libjpeg.so
%{_libdir}/pkgconfig/libjpeg.pc
%{_libdir}/pkgconfig/libturbojpeg.pc
%doc coderules.txt jconfig.txt libjpeg.txt structure.txt example.c
%doc coderules.txt jconfig.txt libjpeg.txt structure.txt tjexample.c
%changelog