diff options
author | Albert Astals Cid <aacid@kde.org> | 2018-10-16 19:58:27 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2018-10-16 19:58:27 +0200 |
commit | 710534c7229c42c85038b4263fc67f4ff4a94182 (patch) | |
tree | 85cba960e8a348382c8f738f21e929b225c5b9b0 | |
parent | 5b9f42db983e1d5e915373cf554a50ce4e9b7ef0 (diff) |
Check for overflow in Splash::scaleImageYdXd
oss-fuzz/11006
-rw-r--r-- | splash/Splash.cc | 5 |
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); |