openbsd-ports/textproc/xpdf/patches/patch-xpdf_SplashOutputDev_cc
stsp 1bfd6642b1 Apply a patch to fix a heap overflow (poppler has the same fix, and xpdf
upstream will release this fix in xpdf-3.03).
Also apply a patch that kili@ lifted from poppler some time ago.
Both patches fix crashes seen with some PDF documents.

ok sthen, "don't wait for me" kili
2011-03-03 21:22:13 +00:00

27 lines
848 B
Plaintext

$OpenBSD: patch-xpdf_SplashOutputDev_cc,v 1.3 2011/03/03 21:22:13 stsp Exp $
Same as poppler commit 37077aa475d2dee81f87daa05297b201eeb99c87.
Fixes a heap overflow.
--- xpdf/SplashOutputDev.cc.orig Tue Feb 27 23:05:52 2007
+++ xpdf/SplashOutputDev.cc Mon Feb 14 00:37:00 2011
@@ -2475,14 +2475,14 @@ void SplashOutputDev::beginTransparencyGroup(GfxState
tx = (int)floor(xMin);
if (tx < 0) {
tx = 0;
- } else if (tx > bitmap->getWidth()) {
- tx = bitmap->getWidth();
+ } else if (tx >= bitmap->getWidth()) {
+ tx = bitmap->getWidth() - 1;
}
ty = (int)floor(yMin);
if (ty < 0) {
ty = 0;
- } else if (ty > bitmap->getHeight()) {
- ty = bitmap->getHeight();
+ } else if (ty >= bitmap->getHeight()) {
+ ty = bitmap->getHeight() - 1;
}
w = (int)ceil(xMax) - tx + 1;
if (tx + w > bitmap->getWidth()) {