add bigendian patch to fix raw_decode self check failure on ppc*, s390*

This commit is contained in:
Karsten Hopp 2012-07-03 16:00:32 +02:00
parent 396b449b01
commit 5f9a7dda1b
2 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,15 @@
diff -up tiff-4.0.2/test/raw_decode.c.bigendian tiff-4.0.2/test/raw_decode.c
--- tiff-4.0.2/test/raw_decode.c.bigendian 2012-07-03 15:27:37.168543695 +0200
+++ tiff-4.0.2/test/raw_decode.c 2012-07-03 15:28:47.795051599 +0200
@@ -85,9 +85,9 @@ static int check_rgb_pixel( int pixel, i
static int check_rgba_pixel( int pixel, int red, int green, int blue, int alpha, unsigned char *buffer ) {
/* RGBA images are upside down - adjust for normal ordering */
int adjusted_pixel = pixel % 128 + (127 - (pixel/128)) * 128;
- unsigned char *rgba = buffer + 4 * adjusted_pixel;
+ unsigned int *rgba = (unsigned int*)(buffer + 4 * adjusted_pixel);
- if( rgba[0] == red && rgba[1] == green && rgba[2] == blue && rgba[3] == alpha ) {
+ if( TIFFGetR(*rgba) == red && TIFFGetG(*rgba) == green && TIFFGetB(*rgba) == blue && TIFFGetA(*rgba) == alpha ) {
return 0;
}

View File

@ -1,7 +1,7 @@
Summary: Library of functions for manipulating TIFF format image files Summary: Library of functions for manipulating TIFF format image files
Name: libtiff Name: libtiff
Version: 4.0.2 Version: 4.0.2
Release: 1%{?dist} Release: 2%{?dist}
License: libtiff License: libtiff
Group: System Environment/Libraries Group: System Environment/Libraries
@ -22,6 +22,7 @@ Source1: ftp://ftp.remotesensing.org/pub/libtiff/tiff-%{prevversion}.tar.gz
Patch2: libtiff-CVE-2012-1173-3.9.patch Patch2: libtiff-CVE-2012-1173-3.9.patch
Patch3: libtiff-CVE-2012-2088.patch Patch3: libtiff-CVE-2012-2088.patch
Patch4: libtiff-CVE-2012-2113.patch Patch4: libtiff-CVE-2012-2113.patch
Patch5: libtiff-4.0.2-bigendian.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: zlib-devel libjpeg-devel jbigkit-devel BuildRequires: zlib-devel libjpeg-devel jbigkit-devel
@ -103,6 +104,7 @@ autoheader
autoconf autoconf
autoheader autoheader
popd popd
%patch5 -p1
%build %build
export CFLAGS="%{optflags} -fno-strict-aliasing" export CFLAGS="%{optflags} -fno-strict-aliasing"
@ -233,6 +235,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/libtiffxx.so.3* %{_libdir}/libtiffxx.so.3*
%changelog %changelog
* Tue Jul 03 2012 Karsten Hopp <karsten@redhat.com> 4.0.2-2
- add opensuse bigendian patch to fix raw_decode self check failure on ppc*, s390*
* Thu Jun 28 2012 Tom Lane <tgl@redhat.com> 4.0.2-1 * Thu Jun 28 2012 Tom Lane <tgl@redhat.com> 4.0.2-1
- Update to libtiff 4.0.2, includes fix for CVE-2012-2113 - Update to libtiff 4.0.2, includes fix for CVE-2012-2113
(note that CVE-2012-2088 does not apply to 4.0.x) (note that CVE-2012-2088 does not apply to 4.0.x)