diff options
author | drochner <drochner@pkgsrc.org> | 2009-11-19 17:58:41 +0000 |
---|---|---|
committer | drochner <drochner@pkgsrc.org> | 2009-11-19 17:58:41 +0000 |
commit | 3ec6ed69b64a186cda39df97003b6403a9e0a9a9 (patch) | |
tree | 5495d21488ec3c8b124e6e7733147f42774b68f3 /print/poppler | |
parent | 09fee0024d2a0024c5ffb886409602e1676e1057 (diff) | |
download | pkgsrc-3ec6ed69b64a186cda39df97003b6403a9e0a9a9.tar.gz |
The code which calculates linear gradients divides by zero under some
circumstances. This leads to NaNs passed to cairo which makes that
literally "nan" is inserted into the output file when printing. The
resulting file crashes ghostscript, and also poppler when it is fed
to it again.
I didn't read PDF specs yet to understand where the math is failing,
just avoided the division by zero.
Diffstat (limited to 'print/poppler')
-rw-r--r-- | print/poppler/Makefile | 4 | ||||
-rw-r--r-- | print/poppler/distinfo | 3 | ||||
-rw-r--r-- | print/poppler/patches/patch-ap | 32 |
3 files changed, 37 insertions, 2 deletions
diff --git a/print/poppler/Makefile b/print/poppler/Makefile index 26f7fddd9bb..a87bb64cb56 100644 --- a/print/poppler/Makefile +++ b/print/poppler/Makefile @@ -1,8 +1,10 @@ -# $NetBSD: Makefile,v 1.43 2009/09/09 19:57:05 drochner Exp $ +# $NetBSD: Makefile,v 1.44 2009/11/19 17:58:41 drochner Exp $ # .include "../../print/poppler/Makefile.common" +PKGREVISION= 1 + COMMENT= PDF rendering library MAINTAINER= reed@reedmedia.net diff --git a/print/poppler/distinfo b/print/poppler/distinfo index 243ab542a4d..77a842285ac 100644 --- a/print/poppler/distinfo +++ b/print/poppler/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.48 2009/10/21 10:18:57 drochner Exp $ +$NetBSD: distinfo,v 1.49 2009/11/19 17:58:41 drochner Exp $ SHA1 (poppler-0.12.1.tar.gz) = 0c8514f789eaab4e91ba1a841f58f8bee95e4a43 RMD160 (poppler-0.12.1.tar.gz) = 92ea043b8b329e23d13068af5cfed8fd47eea5e8 @@ -8,5 +8,6 @@ SHA1 (patch-ab) = 441308aec73c66a34c00ee1fad30a38748c89a7d SHA1 (patch-ag) = 58d01b019daec19de80867ce0941e5160591bf62 SHA1 (patch-ai) = a51dba3fb0e7131873ef82ae5e256fb1d17cee53 SHA1 (patch-ao) = cf7e0f086522147a91f59b1b26ca510d1971ac74 +SHA1 (patch-ap) = f39b70d9420201281a6735114029514ef636f1bb SHA1 (patch-ba) = 9b98dcfae8d997f9250e161faf8cce7f168798b5 SHA1 (patch-bb) = 23fe8bab6eaadc0c9701c0125f07afbf6bffcbaa diff --git a/print/poppler/patches/patch-ap b/print/poppler/patches/patch-ap new file mode 100644 index 00000000000..d3a13a8f40b --- /dev/null +++ b/print/poppler/patches/patch-ap @@ -0,0 +1,32 @@ +$NetBSD: patch-ap,v 1.1 2009/11/19 17:58:41 drochner Exp $ + +--- poppler/Gfx.cc.orig 2009-09-09 23:25:11.000000000 +0200 ++++ poppler/Gfx.cc +@@ -2462,7 +2462,10 @@ void Gfx::doAxialShFill(GfxAxialShading + if (out->useFillColorStop()) { + // make sure we add stop color when t = tMin + state->setFillColor(&color0); +- out->updateFillColorStop(state, (tt - tMin)/(tMax - tMin)); ++ if (tMax == tMin) ++ out->updateFillColorStop(state, tMin); ++ else ++ out->updateFillColorStop(state, (tt - tMin)/(tMax - tMin)); + } + + // compute the coordinates of the point on the t axis at t = tMin; +@@ -2602,9 +2605,12 @@ void Gfx::doAxialShFill(GfxAxialShading + + // set the color + state->setFillColor(&color0); +- if (out->useFillColorStop()) +- out->updateFillColorStop(state, (ta[j] - tMin)/(tMax - tMin)); +- else ++ if (out->useFillColorStop()) { ++ if (tMax == tMin) ++ out->updateFillColorStop(state, tMin); ++ else ++ out->updateFillColorStop(state, (ta[j] - tMin)/(tMax - tMin)); ++ } else + out->updateFillColor(state); + + if (needExtend) { |