From 5f9a7dda1bb1991bf36f98ee37700c75433c9738 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 3 Jul 2012 16:00:32 +0200 Subject: [PATCH] add bigendian patch to fix raw_decode self check failure on ppc*, s390* --- libtiff-4.0.2-bigendian.patch | 15 +++++++++++++++ libtiff.spec | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 libtiff-4.0.2-bigendian.patch diff --git a/libtiff-4.0.2-bigendian.patch b/libtiff-4.0.2-bigendian.patch new file mode 100644 index 0000000..0832254 --- /dev/null +++ b/libtiff-4.0.2-bigendian.patch @@ -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; + } + diff --git a/libtiff.spec b/libtiff.spec index df1b2cf..69db84c 100644 --- a/libtiff.spec +++ b/libtiff.spec @@ -1,7 +1,7 @@ Summary: Library of functions for manipulating TIFF format image files Name: libtiff Version: 4.0.2 -Release: 1%{?dist} +Release: 2%{?dist} License: libtiff 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 Patch3: libtiff-CVE-2012-2088.patch Patch4: libtiff-CVE-2012-2113.patch +Patch5: libtiff-4.0.2-bigendian.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: zlib-devel libjpeg-devel jbigkit-devel @@ -103,6 +104,7 @@ autoheader autoconf autoheader popd +%patch5 -p1 %build export CFLAGS="%{optflags} -fno-strict-aliasing" @@ -233,6 +235,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libtiffxx.so.3* %changelog +* Tue Jul 03 2012 Karsten Hopp 4.0.2-2 +- add opensuse bigendian patch to fix raw_decode self check failure on ppc*, s390* + * Thu Jun 28 2012 Tom Lane 4.0.2-1 - Update to libtiff 4.0.2, includes fix for CVE-2012-2113 (note that CVE-2012-2088 does not apply to 4.0.x)