summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2013-01-09 22:47:28 +0100
committerAlbert Astals Cid <aacid@kde.org>2013-01-09 22:47:28 +0100
commita205e71a2dbe0c8d4f4905a76a3f79ec522eacec (patch)
tree3d59175572ca50732cbf6aaedcdb19ad2d6339b9
parentb1026b5978c385328f2a15a2185c599a563edf91 (diff)
Do not crash in broken documents like 1007.pdf.asan.48.4
-rw-r--r--splash/Splash.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/splash/Splash.cc b/splash/Splash.cc
index 336872b2..2e3687ad 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