From c21cba8632af11963a0267dc939a6b84c5bc6769d3474bee0ebc4f23f0bde706 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Wed, 26 Jun 2013 11:20:47 +0000 Subject: [PATCH] - tiff2pdf: introduced warning when the compression isn't lzw or none [bnc#819142] - tiff2pdf: fixed crash [bnc#821872] OBS-URL: https://build.opensuse.org/package/show/graphics/tiff?expand=0&rev=58 --- tiff-4.0.3-compress-warning.patch | 20 ++++++++++++++++++++ tiff-4.0.3-double-free.patch | 13 +++++++++++++ tiff.changes | 7 +++++++ tiff.spec | 6 ++++++ 4 files changed, 46 insertions(+) create mode 100644 tiff-4.0.3-compress-warning.patch create mode 100644 tiff-4.0.3-double-free.patch diff --git a/tiff-4.0.3-compress-warning.patch b/tiff-4.0.3-compress-warning.patch new file mode 100644 index 0000000..dae54b7 --- /dev/null +++ b/tiff-4.0.3-compress-warning.patch @@ -0,0 +1,20 @@ +Index: tiff-4.0.3/tools/tiff2pdf.c +=================================================================== +--- tiff-4.0.3.orig/tools/tiff2pdf.c ++++ tiff-4.0.3/tools/tiff2pdf.c +@@ -1264,6 +1264,15 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* + return; + + } ++ if(t2p->tiff_compression != COMPRESSION_LZW && ++ t2p->tiff_compression != COMPRESSION_NONE){ ++ TIFFWarning( ++ TIFF2PDF_MODULE, ++ "%s is not compressed with LZW or NONE.\n" ++ "tiff2pdf result may be incorrect in that case.\n" ++ "Consider to use tiffcp(1) to change compress algorithm first.", ++ TIFFFileName(input) ); ++ } + if( TIFFIsCODECConfigured(t2p->tiff_compression) == 0){ + TIFFError( + TIFF2PDF_MODULE, diff --git a/tiff-4.0.3-double-free.patch b/tiff-4.0.3-double-free.patch new file mode 100644 index 0000000..a813cd7 --- /dev/null +++ b/tiff-4.0.3-double-free.patch @@ -0,0 +1,13 @@ +Index: tools/tiff2pdf.c +=================================================================== +--- tools/tiff2pdf.c.orig ++++ tools/tiff2pdf.c +@@ -2436,7 +2436,7 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p + TIFFReadEncodedStrip(input, + i, + (tdata_t) &buffer[bufferoffset], +- stripsize); ++ TIFFmin(stripsize, t2p->tiff_datasize - bufferoffset)); + if(read==-1){ + TIFFError(TIFF2PDF_MODULE, + "Error on decoding strip %u of %s", diff --git a/tiff.changes b/tiff.changes index d0fe1b7..93fd15f 100644 --- a/tiff.changes +++ b/tiff.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jun 26 10:48:50 UTC 2013 - pgajdos@suse.com + +- tiff2pdf: introduced warning when the compression isn't lzw or + none [bnc#819142] +- tiff2pdf: fixed crash [bnc#821872] + ------------------------------------------------------------------- Tue Apr 30 13:20:50 UTC 2013 - pgajdos@suse.com diff --git a/tiff.spec b/tiff.spec index bfe48c6..99f1838 100644 --- a/tiff.spec +++ b/tiff.spec @@ -52,6 +52,10 @@ Patch2: tiff-%{version}-tiff2pdf-colors.patch Patch3: tiff-%{version}-CVE-2012-4564.patch Patch4: tiff-%{version}-CVE-2013-1961.patch Patch5: tiff-%{version}-CVE-2013-1960.patch +# http://bugzilla.maptools.org/show_bug.cgi?id=2443 +Patch6: tiff-%{version}-double-free.patch +# http://bugzilla.maptools.org/show_bug.cgi?id=2442 +Patch7: tiff-%{version}-compress-warning.patch # FYI: this issue is solved another way # http://bugzilla.maptools.org/show_bug.cgi?id=1985#c1 # Patch9: tiff-%{version}-lzw-CVE-2009-2285.patch @@ -101,6 +105,8 @@ the libtiff library. %patch3 %patch4 %patch5 +%patch6 +%patch7 -p1 %build %configure --disable-static --with-pic