pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/tiff Add various bug fixes taken from Debian'...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e1dce8a39bcc
branches:  trunk
changeset: 482032:e1dce8a39bcc
user:      tron <tron%pkgsrc.org@localhost>
date:      Mon Oct 18 14:37:24 2004 +0000

description:
Add various bug fixes taken from Debian's unstable distribution which
include fixes for CESA-2004-006. Bump package revision.

diffstat:

 graphics/tiff/Makefile         |    4 +-
 graphics/tiff/distinfo         |   20 ++-
 graphics/tiff/patches/patch-ag |   58 +++++-
 graphics/tiff/patches/patch-ai |   16 ++
 graphics/tiff/patches/patch-aj |  116 +++++++++++++++
 graphics/tiff/patches/patch-ak |   17 ++
 graphics/tiff/patches/patch-al |   87 +++++++++++
 graphics/tiff/patches/patch-am |   76 ++++++++++
 graphics/tiff/patches/patch-an |   60 +++++++
 graphics/tiff/patches/patch-ao |  311 +++++++++++++++++++++++++++++++++++++++++
 graphics/tiff/patches/patch-ap |   64 ++++++++
 graphics/tiff/patches/patch-aq |   23 +++
 graphics/tiff/patches/patch-ar |   55 +++++++
 graphics/tiff/patches/patch-as |   13 +
 graphics/tiff/patches/patch-at |   68 ++++++++
 graphics/tiff/patches/patch-au |  107 ++++++++++++++
 graphics/tiff/patches/patch-av |   17 ++
 graphics/tiff/patches/patch-aw |  100 +++++++++++++
 graphics/tiff/patches/patch-ax |   44 +++++
 19 files changed, 1238 insertions(+), 18 deletions(-)

diffs (truncated from 1357 to 300 lines):

diff -r 141918becc0a -r e1dce8a39bcc graphics/tiff/Makefile
--- a/graphics/tiff/Makefile    Mon Oct 18 14:23:29 2004 +0000
+++ b/graphics/tiff/Makefile    Mon Oct 18 14:37:24 2004 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.57 2004/10/18 10:30:33 tron Exp $
+# $NetBSD: Makefile,v 1.58 2004/10/18 14:37:24 tron Exp $
 
 DISTNAME=      tiff-v3.6.1
 PKGNAME=       ${DISTNAME:S/-v/-/}
-PKGREVISION=   3
+PKGREVISION=   4
 CATEGORIES=    graphics
 MASTER_SITES=  ftp://ftp.remotesensing.org/pub/libtiff/old/ \
                ftp://ftp.fu-berlin.de/unix/graphics/tiff/old/
diff -r 141918becc0a -r e1dce8a39bcc graphics/tiff/distinfo
--- a/graphics/tiff/distinfo    Mon Oct 18 14:23:29 2004 +0000
+++ b/graphics/tiff/distinfo    Mon Oct 18 14:37:24 2004 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.17 2004/09/05 16:49:03 jschauma Exp $
+$NetBSD: distinfo,v 1.18 2004/10/18 14:37:24 tron Exp $
 
 SHA1 (tiff-3.6.1/tiff-v3.6.1.tar.gz) = f7817145d8756152cc341804df6477f37ef93c38
 Size (tiff-3.6.1/tiff-v3.6.1.tar.gz) = 1072165 bytes
@@ -12,5 +12,21 @@
 SHA1 (patch-ad) = b48c93d29d5ff39079b6d320c5e67d9c1cdde8c7
 SHA1 (patch-ae) = 8272e39a8a0324b0f8a1e661721b5c9367c0d8e7
 SHA1 (patch-af) = d6c9fd4f10c26e6b2ad8eb5ec51e9205504b62c7
-SHA1 (patch-ag) = 169a504fc9c4180b3b14a7d2f0e2318af9879f17
+SHA1 (patch-ag) = 01be3aaddf62748bb575ae8cc71014566f519ce7
 SHA1 (patch-ah) = 44ecf92862dc20cdb5e4b1dd4cdbf7c765dc95e2
+SHA1 (patch-ai) = cab07f23d9ef47008fee393f1d4c2438d0c96124
+SHA1 (patch-aj) = 9ea4c71308e73a20f10befcfabe31ecfce794519
+SHA1 (patch-ak) = f3375d4b1f6a93c0a14c05ba2047ede622ddae9a
+SHA1 (patch-al) = 203c17a448cf61d9b92bf24b93ca87dc8aff2454
+SHA1 (patch-am) = 812da6e94797ae976b86c65888804f470abda7a0
+SHA1 (patch-an) = 22589375f39ec68e848efc3e11fb5142e8247919
+SHA1 (patch-ao) = 876bd5bf2c3dcc41c31396afc3d1adc6ce279a77
+SHA1 (patch-ap) = 83a15df9ecb4c8c81c808c02ea59f0941c4ba135
+SHA1 (patch-aq) = d9056e59e185bc8a7e6375ba0f9c9ffc6f537344
+SHA1 (patch-ar) = 9ba144120468a1674276dab4fc15ebba54e594fe
+SHA1 (patch-as) = 6f4cb72b8fb2bfd638014cb074f789f93b1d892b
+SHA1 (patch-at) = 306fe455551affe97bb4b5febb4c72cc498528e5
+SHA1 (patch-au) = a80951b097925c25c295abdb4c79fd431c094965
+SHA1 (patch-av) = 6610c19feddf1fe7f2ba4a9ff2bb52383a91ad75
+SHA1 (patch-aw) = 56fe3328e27f11e3f0220a1637d21c7abe0568a0
+SHA1 (patch-ax) = 3beda76b748e62f034b9a554fea95f37137e30fb
diff -r 141918becc0a -r e1dce8a39bcc graphics/tiff/patches/patch-ag
--- a/graphics/tiff/patches/patch-ag    Mon Oct 18 14:23:29 2004 +0000
+++ b/graphics/tiff/patches/patch-ag    Mon Oct 18 14:37:24 2004 +0000
@@ -1,17 +1,30 @@
-$NetBSD: patch-ag,v 1.6 2004/03/22 17:03:30 abs Exp $
+$NetBSD: patch-ag,v 1.7 2004/10/18 14:37:24 tron Exp $
 
---- libtiff/tif_fax3.c.orig    Thu Nov  6 08:22:13 2003
-+++ libtiff/tif_fax3.c
-@@ -309,7 +309,7 @@ Fax3Decode2D(TIFF* tif, tidata_t buf, ts
-  * this is <8 bytes.  We optimize the code here to reflect the
-  * machine characteristics.
-  */
--#if defined(__alpha) || _MIPS_SZLONG == 64 || defined(__LP64__) || defined(__arch64__)
-+#if defined(__alpha) || _MIPS_SZLONG == 64 || defined(__LP64__) || defined(__arch64__) || defined(_LP64)
- #define FILL(n, cp)                                                       \
-     switch (n) {                                                          \
-     case 15:(cp)[14] = 0xff; case 14:(cp)[13] = 0xff; case 13: (cp)[12] = 0xff;\
-@@ -451,7 +451,7 @@ Fax3SetupState(TIFF* tif)
+--- libtiff/tif_fax3.c.orig    2003-11-06 09:22:13.000000000 +0100
++++ libtiff/tif_fax3.c 2004-10-18 16:24:04.000000000 +0200
+@@ -437,6 +437,21 @@
+ #undef        ZERO
+ #undef        FILL
+ 
++static char *
++CheckMalloc(TIFF* tif, size_t nmemb, size_t elem_size, const char* what)
++{
++      char    *cp = NULL;
++      tsize_t bytes = nmemb * elem_size;
++
++      if (elem_size && bytes / elem_size == nmemb)
++              cp = (char*) _TIFFmalloc(bytes);
++
++      if (cp == NULL)
++              TIFFError(tif->tif_name, "No space %s", what);
++      
++      return (cp);
++}
++
+ /*
+  * Setup G3/G4-related compression/decompression state
+  * before data is processed.  This routine is called once
+@@ -451,7 +466,7 @@
        Fax3BaseState* sp = Fax3State(tif);
        long rowbytes, rowpixels;
        int needsRefLine;
@@ -20,7 +33,24 @@
        uint32 nruns;
  
        if (td->td_bitspersample != 1) {
-@@ -1284,7 +1284,8 @@ InitCCITTFax3(TIFF* tif)
+@@ -481,13 +496,10 @@
+ 
+       nruns = needsRefLine ? 2*TIFFroundup(rowpixels,32) : rowpixels;
+ 
+-      dsp->runs = (uint32*) _TIFFmalloc((2*nruns+3)*sizeof (uint32));
+-      if (dsp->runs == NULL) {
+-              TIFFError("Fax3SetupState",
+-                  "%s: No space for Group 3/4 run arrays",
+-                  tif->tif_name);
++      dsp->runs = (uint32*) CheckMalloc(tif, 2*nruns+3, sizeof (uint32),
++                                        "for Group 3/4 run arrays");
++      if (dsp->runs == NULL)
+               return (0);
+-      }
+       dsp->curruns = dsp->runs;
+       if (needsRefLine)
+               dsp->refruns = dsp->runs + (nruns>>1);
+@@ -1284,7 +1296,8 @@
        sp->recvparams = 0;
        sp->subaddress = NULL;
  
diff -r 141918becc0a -r e1dce8a39bcc graphics/tiff/patches/patch-ai
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/tiff/patches/patch-ai    Mon Oct 18 14:37:24 2004 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-ai,v 1.1 2004/10/18 14:37:24 tron Exp $
+
+--- libtiff/tiffiop.h.orig     2003-12-26 12:56:25.000000000 +0100
++++ libtiff/tiffiop.h  2004-10-18 16:25:32.000000000 +0200
+@@ -198,8 +198,9 @@
+ #endif
+ 
+ /* NB: the uint32 casts are to silence certain ANSI-C compilers */
+-#define       TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y)))
+-#define       TIFFroundup(x, y) (TIFFhowmany(x,y)*((uint32)(y)))
++#define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y)))
++#define TIFFhowmany8(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3)
++#define       TIFFroundup(x, y) (TIFFhowmany(x,y)*(y))
+ 
+ #define TIFFmax(A,B) ((A)>(B)?(A):(B))
+ #define TIFFmin(A,B) ((A)<(B)?(A):(B))
diff -r 141918becc0a -r e1dce8a39bcc graphics/tiff/patches/patch-aj
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/tiff/patches/patch-aj    Mon Oct 18 14:37:24 2004 +0000
@@ -0,0 +1,116 @@
+$NetBSD: patch-aj,v 1.1 2004/10/18 14:37:24 tron Exp $
+
+--- libtiff/tif_aux.c.orig     2003-12-07 12:58:36.000000000 +0100
++++ libtiff/tif_aux.c  2004-10-18 16:25:32.000000000 +0200
+@@ -33,36 +33,59 @@
+ #include "tif_predict.h"
+ #include <math.h>
+ 
+-static void
++static int
+ TIFFDefaultTransferFunction(TIFFDirectory* td)
+ {
+       uint16 **tf = td->td_transferfunction;
+-      long i, n = 1<<td->td_bitspersample;
++      tsize_t i, n, nbytes;
+ 
+-      tf[0] = (uint16 *)_TIFFmalloc(n * sizeof (uint16));
++      tf[0] = tf[1] = tf[2] = 0;
++      if (td->td_bitspersample >= sizeof(tsize_t) * 8 - 2)
++              return 0;
++
++      n = 1<<td->td_bitspersample;
++      nbytes = n * sizeof (uint16);
++      if (!(tf[0] = (uint16 *)_TIFFmalloc(nbytes)))
++              return 0;
+       tf[0][0] = 0;
+       for (i = 1; i < n; i++) {
+               double t = (double)i/((double) n-1.);
+               tf[0][i] = (uint16)floor(65535.*pow(t, 2.2) + .5);
+       }
++
+       if (td->td_samplesperpixel - td->td_extrasamples > 1) {
+-              tf[1] = (uint16 *)_TIFFmalloc(n * sizeof (uint16));
+-              _TIFFmemcpy(tf[1], tf[0], n * sizeof (uint16));
+-              tf[2] = (uint16 *)_TIFFmalloc(n * sizeof (uint16));
+-              _TIFFmemcpy(tf[2], tf[0], n * sizeof (uint16));
++              if (!(tf[1] = (uint16 *)_TIFFmalloc(nbytes)))
++                      goto bad;
++              _TIFFmemcpy(tf[1], tf[0], nbytes);
++              if (!(tf[2] = (uint16 *)_TIFFmalloc(nbytes)))
++                      goto bad;
++              _TIFFmemcpy(tf[2], tf[0], nbytes);
+       }
++      return 1;
++
++bad:
++      if (tf[0])
++              _TIFFfree(tf[0]);
++      if (tf[1])
++              _TIFFfree(tf[1]);
++      if (tf[2])
++              _TIFFfree(tf[2]);
++      tf[0] = tf[1] = tf[2] = 0;
++      return 0;
+ }
+ 
+-static void
++static int
+ TIFFDefaultRefBlackWhite(TIFFDirectory* td)
+ {
+       int i;
+ 
+-      td->td_refblackwhite = (float *)_TIFFmalloc(6*sizeof (float));
++      if (!(td->td_refblackwhite = (float *)_TIFFmalloc(6*sizeof (float))))
++              return 0;
+       for (i = 0; i < 3; i++) {
+           td->td_refblackwhite[2*i+0] = 0;
+           td->td_refblackwhite[2*i+1] = (float)((1L<<td->td_bitspersample)-1L);
+       }
++      return 1;
+ }
+ 
+ /*
+@@ -155,6 +178,8 @@
+               if (!td->td_ycbcrcoeffs) {
+                       td->td_ycbcrcoeffs = (float *)
+                           _TIFFmalloc(3*sizeof (float));
++                      if (!td->td_ycbcrcoeffs)
++                              return (0);
+                       /* defaults are from CCIR Recommendation 601-1 */
+                       td->td_ycbcrcoeffs[0] = 0.299f;
+                       td->td_ycbcrcoeffs[1] = 0.587f;
+@@ -173,6 +198,8 @@
+               if (!td->td_whitepoint) {
+                       td->td_whitepoint = (float *)
+                               _TIFFmalloc(2 * sizeof (float));
++                      if (!td->td_whitepoint)
++                              return (0);
+                       /* TIFF 6.0 specification says that it is no default
+                          value for the WhitePoint, but AdobePhotoshop TIFF
+                          Technical Note tells that it should be CIE D50. */
+@@ -184,8 +211,11 @@
+               *va_arg(ap, float **) = td->td_whitepoint;
+               return (1);
+       case TIFFTAG_TRANSFERFUNCTION:
+-              if (!td->td_transferfunction[0])
+-                      TIFFDefaultTransferFunction(td);
++              if (!td->td_transferfunction[0] &&
++                  !TIFFDefaultTransferFunction(td)) {
++                      TIFFError(tif->tif_name, "No space for \"TransferFunction\" tag");
++                      return (0);
++              }
+               *va_arg(ap, uint16 **) = td->td_transferfunction[0];
+               if (td->td_samplesperpixel - td->td_extrasamples > 1) {
+                       *va_arg(ap, uint16 **) = td->td_transferfunction[1];
+@@ -193,8 +223,8 @@
+               }
+               return (1);
+       case TIFFTAG_REFERENCEBLACKWHITE:
+-              if (!td->td_refblackwhite)
+-                      TIFFDefaultRefBlackWhite(td);
++              if (!td->td_refblackwhite && !TIFFDefaultRefBlackWhite(td))
++                      return (0);
+               *va_arg(ap, float **) = td->td_refblackwhite;
+               return (1);
+       }
diff -r 141918becc0a -r e1dce8a39bcc graphics/tiff/patches/patch-ak
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/tiff/patches/patch-ak    Mon Oct 18 14:37:24 2004 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-ak,v 1.1 2004/10/18 14:37:24 tron Exp $
+
+--- libtiff/tif_compress.c.orig        2002-04-09 19:51:29.000000000 +0200
++++ libtiff/tif_compress.c     2004-10-18 16:25:32.000000000 +0200
+@@ -210,9 +210,11 @@
+               cd->info->init = init;
+               cd->next = registeredCODECS;
+               registeredCODECS = cd;
+-      } else
++      } else {
+               TIFFError("TIFFRegisterCODEC",
+                   "No space to register compression scheme %s", name);
++              return NULL;
++      }
+       return (cd->info);
+ }
+ 
diff -r 141918becc0a -r e1dce8a39bcc graphics/tiff/patches/patch-al
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/tiff/patches/patch-al    Mon Oct 18 14:37:24 2004 +0000
@@ -0,0 +1,87 @@
+$NetBSD: patch-al,v 1.1 2004/10/18 14:37:24 tron Exp $
+
+--- libtiff/tif_dir.c.orig     2003-12-26 12:56:25.000000000 +0100
++++ libtiff/tif_dir.c  2004-10-18 16:25:32.000000000 +0200
+@@ -40,26 +40,33 @@
+ #define DATATYPE_UINT         2       /* !unsigned integer data */
+ #define DATATYPE_IEEEFP               3       /* !IEEE floating point data */
+ 
+-void
+-_TIFFsetByteArray(void** vpp, void* vp, long n)
++static void
++setByteArray(void** vpp, void* vp, size_t nmemb, size_t elem_size)
+ {
+       if (*vpp)
+               _TIFFfree(*vpp), *vpp = 0;
+-      if (vp && (*vpp = (void*) _TIFFmalloc(n)))



Home | Main Index | Thread Index | Old Index