summaryrefslogtreecommitdiff
path: root/graphics/tiff/patches/patch-ag
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/tiff/patches/patch-ag')
-rw-r--r--graphics/tiff/patches/patch-ag62
1 files changed, 0 insertions, 62 deletions
diff --git a/graphics/tiff/patches/patch-ag b/graphics/tiff/patches/patch-ag
deleted file mode 100644
index 377ae4c0cf2..00000000000
--- a/graphics/tiff/patches/patch-ag
+++ /dev/null
@@ -1,62 +0,0 @@
-$NetBSD: patch-ag,v 1.8 2004/12/22 03:57:15 reed Exp $
-
---- 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 (nmemb && 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;
-- Fax3CodecState* dsp = DecoderState(tif);
-+ Fax3CodecState* dsp = (Fax3CodecState*) Fax3State(tif);
- uint32 nruns;
-
- if (td->td_bitspersample != 1) {
-@@ -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;
-
-- tif->tif_flags |= TIFF_NOBITREV; /* decoder does bit reversal */
-+ if (sp->rw_mode == O_RDONLY) /* FIXME: improve for in place update */
-+ tif->tif_flags |= TIFF_NOBITREV; /* decoder does bit reversal */
- DecoderState(tif)->runs = NULL;
- TIFFSetField(tif, TIFFTAG_FAXFILLFUNC, _TIFFFax3fillruns);
- EncoderState(tif)->refline = NULL;