summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2018-10-16 19:58:27 +0200
committerAlbert Astals Cid <aacid@kde.org>2018-10-16 19:58:27 +0200
commit710534c7229c42c85038b4263fc67f4ff4a94182 (patch)
tree85cba960e8a348382c8f738f21e929b225c5b9b0
parent5b9f42db983e1d5e915373cf554a50ce4e9b7ef0 (diff)
Check for overflow in Splash::scaleImageYdXd
oss-fuzz/11006
-rw-r--r--splash/Splash.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/splash/Splash.cc b/splash/Splash.cc
index eb2c909c..18a40675 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -4241,7 +4241,10 @@ void Splash::scaleImageYdXd(SplashImageSource src, void *srcData,
xq = srcWidth % scaledWidth;
// allocate buffers
- lineBuf = (Guchar *)gmallocn(srcWidth, nComps);
+ lineBuf = (Guchar *)gmallocn_checkoverflow(srcWidth, nComps);
+ if (unlikely(!lineBuf)) {
+ return;
+ }
pixBuf = (Guint *)gmallocn_checkoverflow(srcWidth, nComps * sizeof(int));
if (unlikely(!pixBuf)) {
gfree(lineBuf);