summaryrefslogtreecommitdiff
authorAlbert Astals Cid <aacid@kde.org>2013-01-09 21:47:28 (GMT)
committer Albert Astals Cid <aacid@kde.org>2013-01-09 21:47:28 (GMT)
commita205e71a2dbe0c8d4f4905a76a3f79ec522eacec (patch) (side-by-side diff)
tree3d59175572ca50732cbf6aaedcdb19ad2d6339b9
parentb1026b5978c385328f2a15a2185c599a563edf91 (diff)
downloadpoppler-a205e71a2dbe0c8d4f4905a76a3f79ec522eacec.zip
poppler-a205e71a2dbe0c8d4f4905a76a3f79ec522eacec.tar.gz
Do not crash in broken documents like 1007.pdf.asan.48.4
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--splash/Splash.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/splash/Splash.cc b/splash/Splash.cc
index 336872b..2e3687a 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -2954,6 +2954,11 @@ void Splash::arbitraryTransformMask(SplashImageMaskSource src, void *srcData,
// scale the input image
scaledMask = scaleMask(src, srcData, srcWidth, srcHeight,
scaledWidth, scaledHeight);
+ if (scaledMask->data == NULL) {
+ error(errInternal, -1, "scaledMask->data is NULL in Splash::scaleMaskYuXu");
+ delete scaledMask;
+ return;
+ }
// construct the three sections
i = (vy[2] <= vy[3]) ? 2 : 3;
@@ -3381,6 +3386,12 @@ void Splash::scaleMaskYuXu(SplashImageMaskSource src, void *srcData,
int yp, yq, xp, xq, yt, y, yStep, xt, x, xStep, xx;
int i, j;
+ destPtr0 = dest->data;
+ if (destPtr0 == NULL) {
+ error(errInternal, -1, "dest->data is NULL in Splash::scaleMaskYuXu");
+ return;
+ }
+
// Bresenham parameters for y scale
yp = scaledHeight / srcHeight;
yq = scaledHeight % srcHeight;
@@ -3395,7 +3406,6 @@ void Splash::scaleMaskYuXu(SplashImageMaskSource src, void *srcData,
// init y scale Bresenham
yt = 0;
- destPtr0 = dest->data;
for (y = 0; y < srcHeight; ++y) {
// y scale Bresenham