summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2013-01-09 21:56:45 (GMT)
committerAlbert Astals Cid <aacid@kde.org>2013-01-09 21:56:45 (GMT)
commita9b8ab4657dec65b8b86c225d12c533ad7e984e2 (patch)
tree8e0572594a33cd5ec09d42861151a25ba9f61b93
parent7266a634e01e20648cc877371edc95651d30d4fc (diff)
Fix crash in broken file 1031.pdf.asan.48.15
-rw-r--r--splash/Splash.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/splash/Splash.cc b/splash/Splash.cc
index 0b33022..24d934a 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -2955,7 +2955,7 @@ void Splash::arbitraryTransformMask(SplashImageMaskSource src, void *srcData,
scaledMask = scaleMask(src, srcData, srcWidth, srcHeight,
scaledWidth, scaledHeight);
if (scaledMask->data == NULL) {
- error(errInternal, -1, "scaledMask->data is NULL in Splash::scaleMaskYuXu");
+ error(errInternal, -1, "scaledMask->data is NULL in Splash::arbitraryTransformMask");
delete scaledMask;
return;
}
@@ -3461,11 +3461,15 @@ void Splash::blitMask(SplashBitmap *src, int xDest, int yDest,
w = src->getWidth();
h = src->getHeight();
+ p = src->getDataPtr();
+ if (p == NULL) {
+ error(errInternal, -1, "src->getDataPtr() is NULL in Splash::blitMask");
+ return;
+ }
if (vectorAntialias && clipRes != splashClipAllInside) {
pipeInit(&pipe, xDest, yDest, state->fillPattern, NULL,
(Guchar)splashRound(state->fillAlpha * 255), gTrue, gFalse);
drawAAPixelInit();
- p = src->getDataPtr();
for (y = 0; y < h; ++y) {
for (x = 0; x < w; ++x) {
pipe.shape = *p++;
@@ -3475,7 +3479,6 @@ void Splash::blitMask(SplashBitmap *src, int xDest, int yDest,
} else {
pipeInit(&pipe, xDest, yDest, state->fillPattern, NULL,
(Guchar)splashRound(state->fillAlpha * 255), gTrue, gFalse);
- p = src->getDataPtr();
if (clipRes == splashClipAllInside) {
for (y = 0; y < h; ++y) {
pipeSetXY(&pipe, xDest, yDest + y);