packages: libtiff/libtiff.spec, libtiff/libtiff-sec.patch - sec patch is ba...

qboosh qboosh at pld-linux.org
Sun Apr 17 10:35:32 CEST 2011


Author: qboosh                       Date: Sun Apr 17 08:35:32 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- sec patch is back (only 3 hunks obsolete)
- release 2

---- Files affected:
packages/libtiff:
   libtiff.spec (1.110 -> 1.111) , libtiff-sec.patch (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: packages/libtiff/libtiff.spec
diff -u packages/libtiff/libtiff.spec:1.110 packages/libtiff/libtiff.spec:1.111
--- packages/libtiff/libtiff.spec:1.110	Fri Apr 15 14:58:00 2011
+++ packages/libtiff/libtiff.spec	Sun Apr 17 10:35:27 2011
@@ -10,13 +10,14 @@
 Summary(tr.UTF-8):	TIFF dosyalarını işleme kitaplığı
 Name:		libtiff
 Version:	3.9.5
-Release:	1
+Release:	2
 License:	BSD-like
 Group:		Libraries
 Source0:	ftp://ftp.remotesensing.org/pub/libtiff/tiff-%{version}.tar.gz
 # Source0-md5:	8fc7ce3b4e1d0cc8a319336967815084
 Patch0:		%{name}-glut.patch
 Patch1:		%{name}-CVE-2009-2285.patch
+Patch2:		%{name}-sec.patch
 URL:		http://www.remotesensing.org/libtiff/
 %{?with_opengl:BuildRequires:  OpenGL-glut-devel}
 BuildRequires:	autoconf >= 2.64
@@ -163,6 +164,7 @@
 %setup -q -n tiff-%{version}
 %patch0 -p0
 %patch1 -p1
+%patch2 -p1
 
 %{__rm} m4/{libtool,lt*}.m4
 
@@ -248,6 +250,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.111  2011/04/17 08:35:27  qboosh
+- sec patch is back (only 3 hunks obsolete)
+- release 2
+
 Revision 1.110  2011/04/15 12:58:00  lisu
 - up to 3.9.5
 - drop obsoleted -sec.patch

================================================================
Index: packages/libtiff/libtiff-sec.patch
diff -u /dev/null packages/libtiff/libtiff-sec.patch:1.5
--- /dev/null	Sun Apr 17 10:35:32 2011
+++ packages/libtiff/libtiff-sec.patch	Sun Apr 17 10:35:27 2011
@@ -0,0 +1,211 @@
+--- tiff-3.9.1/libtiff/tif_dir.c.orig	2009-01-01 01:10:43.000000000 +0100
++++ tiff-3.9.1/libtiff/tif_dir.c	2009-08-31 17:46:34.892612613 +0200
+@@ -138,6 +138,7 @@ _TIFFVSetField(TIFF* tif, ttag_t tag, va
+ {
+ 	static const char module[] = "_TIFFVSetField";
+ 
++	const TIFFFieldInfo* fip;
+ 	TIFFDirectory* td = &tif->tif_dir;
+ 	int status = 1;
+ 	uint32 v32, i, v;
+@@ -585,17 +586,19 @@ end:
+ 	va_end(ap);
+ 	return (status);
+ badvalue:
++	fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY);
+ 	TIFFErrorExt(tif->tif_clientdata, module,
+ 		     "%s: Bad value %d for \"%s\" tag",
+ 		     tif->tif_name, v,
+-		     _TIFFFieldWithTag(tif, tag)->field_name);
++		     fip ? fip->field_name : "Unknown");
+ 	va_end(ap);
+ 	return (0);
+ badvalue32:
++	fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY);
+ 	TIFFErrorExt(tif->tif_clientdata, module,
+ 		     "%s: Bad value %u for \"%s\" tag",
+ 		     tif->tif_name, v32,
+-		     _TIFFFieldWithTag(tif, tag)->field_name);
++		     fip ? fip->field_name : "Unknown");
+ 	va_end(ap);
+ 	return (0);
+ }
+--- tiff-3.9.1/libtiff/tif_dirread.c.orig	2009-01-01 01:10:43.000000000 +0100
++++ tiff-3.9.1/libtiff/tif_dirread.c	2009-08-31 18:38:28.060606747 +0200
+@@ -190,6 +190,11 @@ TIFFReadDirectory(TIFF* tif)
+ 						       dp->tdir_tag,
+ 						       dp->tdir_tag);
+ 
++					if (!compressionknown) {
++						TIFFWarningExt(tif->tif_clientdata, module,
++								"Ignoring, compression unknown");
++						goto ignore;
++					}
+ 					if (!_TIFFMergeFieldInfo(tif,
+ 						_TIFFCreateAnonFieldInfo(tif,
+ 						dp->tdir_tag,
+@@ -583,6 +588,7 @@ TIFFReadDirectory(TIFF* tif)
+ 		 * Attempt to deal with a missing StripByteCounts tag.
+ 		 */
+ 		if (!TIFFFieldSet(tif, FIELD_STRIPBYTECOUNTS)) {
++			const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS);
+ 			/*
+ 			 * Some manufacturers violate the spec by not giving
+ 			 * the size of the strips.  In this case, assume there
+@@ -599,7 +605,7 @@ TIFFReadDirectory(TIFF* tif)
+ 				"%s: TIFF directory is missing required "
+ 				"\"%s\" field, calculating from imagelength",
+ 				tif->tif_name,
+-				_TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
++				fip ? fip->field_name : "Unknown");
+ 			if (EstimateStripByteCounts(tif, dir, dircount) < 0)
+ 			    goto bad;
+ 		/*
+@@ -626,6 +632,7 @@ TIFFReadDirectory(TIFF* tif)
+ 		} else if (td->td_nstrips == 1
+ 			   && td->td_stripoffset[0] != 0
+ 			   && BYTECOUNTLOOKSBAD) {
++			const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS);
+ 			/*
+ 			 * XXX: Plexus (and others) sometimes give a value of
+ 			 * zero for a tag when they don't know what the
+@@ -635,7 +642,7 @@ TIFFReadDirectory(TIFF* tif)
+ 			TIFFWarningExt(tif->tif_clientdata, module,
+ 	"%s: Bogus \"%s\" field, ignoring and calculating from imagelength",
+ 				    tif->tif_name,
+-				    _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
++				    fip ? fip->field_name : "Unknown");
+ 			if(EstimateStripByteCounts(tif, dir, dircount) < 0)
+ 			    goto bad;
+ 		} else if (td->td_planarconfig == PLANARCONFIG_CONTIG
+@@ -644,6 +651,7 @@ TIFFReadDirectory(TIFF* tif)
+ 			   && td->td_stripbytecount[0] != td->td_stripbytecount[1]
+                            && td->td_stripbytecount[0] != 0 
+                            && td->td_stripbytecount[1] != 0 ) {
++			const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, TIFFTAG_STRIPBYTECOUNTS);
+ 			/*
+ 			 * XXX: Some vendors fill StripByteCount array with 
+                          * absolutely wrong values (it can be equal to 
+@@ -653,7 +661,7 @@ TIFFReadDirectory(TIFF* tif)
+ 			TIFFWarningExt(tif->tif_clientdata, module,
+ 	"%s: Wrong \"%s\" field, ignoring and calculating from imagelength",
+ 				    tif->tif_name,
+-				    _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name);
++				    fip ? fip->field_name : "Unknown");
+ 			if (EstimateStripByteCounts(tif, dir, dircount) < 0)
+ 			    goto bad;
+ 		}
+@@ -1024,16 +1032,18 @@ TIFFCheckDirOffset(TIFF* tif, toff_t dir
+ static int
+ CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32 count)
+ {
++	const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
++
+ 	if (count > dir->tdir_count) {
+ 		TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
+ 	"incorrect count for field \"%s\" (%u, expecting %u); tag ignored",
+-		    _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name,
++		    fip ? fip->field_name : "Unknown",
+ 		    dir->tdir_count, count);
+ 		return (0);
+ 	} else if (count < dir->tdir_count) {
+ 		TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
+ 	"incorrect count for field \"%s\" (%u, expecting %u); tag trimmed",
+-		    _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name,
++		    fip ? fip->field_name : "Unknown",
+ 		    dir->tdir_count, count);
+ 		return (1);
+ 	}
+@@ -1153,6 +1163,7 @@ static tsize_t
+ TIFFFetchData(TIFF* tif, TIFFDirEntry* dir, char* cp)
+ {
+ 	uint32 w = TIFFDataWidth((TIFFDataType) dir->tdir_type);
++	const TIFFFieldInfo* fip;
+ 	/* 
+ 	 * FIXME: butecount should have tsize_t type, but for now libtiff
+ 	 * defines tsize_t as a signed 32-bit integer and we are losing
+@@ -1200,9 +1211,10 @@ TIFFFetchData(TIFF* tif, TIFFDirEntry* d
+ 	}
+ 	return (cc);
+ bad:
++	fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
+ 	TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+ 		     "Error fetching data for field \"%s\"",
+-		     _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
++		     fip ? fip->field_name : "Unknown");
+ 	return (tsize_t) 0;
+ }
+ 
+@@ -1229,9 +1241,10 @@ static int
+ cvtRational(TIFF* tif, TIFFDirEntry* dir, uint32 num, uint32 denom, float* rv)
+ {
+ 	if (denom == 0) {
++		const TIFFFieldInfo *fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
+ 		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+ 		    "%s: Rational with zero denominator (num = %u)",
+-		    _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name, num);
++		    fip ? fip->field_name : "Unknown", num);
+ 		return (0);
+ 	} else {
+ 		if (dir->tdir_type == TIFF_RATIONAL)
+@@ -1351,9 +1364,10 @@ TIFFFetchShortPair(TIFF* tif, TIFFDirEnt
+ 	 * check on tdir_count, this should never be greater than two.
+ 	 */
+ 	if (dir->tdir_count > 2) {
++		const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
+ 		TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
+ 		"unexpected count for field \"%s\", %u, expected 2; ignored",
+-			_TIFFFieldWithTag(tif, dir->tdir_tag)->field_name,
++			fip ? fip->field_name : "Unknown",
+ 			dir->tdir_count);
+ 		return 0;
+ 	}
+@@ -1529,11 +1543,14 @@ TIFFFetchAnyArray(TIFF* tif, TIFFDirEntr
+ 		/* TIFF_NOTYPE */
+ 		/* TIFF_ASCII */
+ 		/* TIFF_UNDEFINED */
++		{
++		const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
+ 		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+ 			     "cannot read TIFF_ANY type %d for field \"%s\"",
+ 			     dir->tdir_type,
+-			     _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
++			     fip ? fip->field_name : "Unknown");
+ 		return (0);
++		}
+ 	}
+ 	return (1);
+ }
+@@ -1548,6 +1565,8 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEnt
+ 	int ok = 0;
+ 	const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dp->tdir_tag);
+ 
++	if (fip == NULL)
++		return (0);
+ 	if (dp->tdir_count > 1) {		/* array of values */
+ 		char* cp = NULL;
+ 
+@@ -1707,9 +1726,10 @@ TIFFFetchPerSampleShorts(TIFF* tif, TIFF
+ 
+             for (i = 1; i < check_count; i++)
+                 if (v[i] != v[0]) {
++			const TIFFFieldInfo *fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
+ 			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+                 "Cannot handle different per-sample values for field \"%s\"",
+-			_TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
++			fip ? fip->field_name : "Unknown");
+ 			goto bad;
+                 }
+             *pl = v[0];
+@@ -1748,9 +1768,10 @@ TIFFFetchPerSampleLongs(TIFF* tif, TIFFD
+                 check_count = samples;
+             for (i = 1; i < check_count; i++)
+                 if (v[i] != v[0]) {
++			const TIFFFieldInfo *fip = _TIFFFieldWithTag(tif, dir->tdir_tag);
+ 			TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+                 "Cannot handle different per-sample values for field \"%s\"",
+-			_TIFFFieldWithTag(tif, dir->tdir_tag)->field_name);
++			fip ? fip->field_name : "Unknown");
+ 			goto bad;
+                 }
+             *pl = v[0];
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/libtiff/libtiff.spec?r1=1.110&r2=1.111&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/libtiff/libtiff-sec.patch?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list