summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2013-08-16 23:58:44 +0200
committerAlbert Astals Cid <aacid@kde.org>2013-08-17 01:12:48 +0200
commit681f52a572b08c068cb376e5b2dc8a31676aad07 (patch)
tree40491debcaa92263032585bbe977424eeea22f30
parent9f4d7796589e4c9c1645fbbcf0cfabd79a71bde9 (diff)
Fix exit(1) in 1026.asan.0.42.pdf
The main crash in discussion with Thomas
-rw-r--r--splash/Splash.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/splash/Splash.cc b/splash/Splash.cc
index bc7d79ff..ccfe1ed6 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -4504,7 +4504,9 @@ void Splash::scaleImageYuXd(SplashImageSource src, void *srcData,
xq = srcWidth % scaledWidth;
// allocate buffers
- lineBuf = (Guchar *)gmallocn(srcWidth, nComps);
+ lineBuf = (Guchar *)gmallocn_checkoverflow(srcWidth, nComps);
+ if (unlikely(!lineBuf))
+ return;
if (srcAlpha) {
alphaLineBuf = (Guchar *)gmalloc(srcWidth);
} else {