diff options
author | Albert Astals Cid <aacid@kde.org> | 2013-01-09 22:56:45 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2013-01-09 22:56:45 +0100 |
commit | a9b8ab4657dec65b8b86c225d12c533ad7e984e2 (patch) | |
tree | 8e0572594a33cd5ec09d42861151a25ba9f61b93 | |
parent | 7266a634e01e20648cc877371edc95651d30d4fc (diff) |
Fix crash in broken file 1031.pdf.asan.48.15
-rw-r--r-- | splash/Splash.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/splash/Splash.cc b/splash/Splash.cc index 0b330228..24d934ab 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); |