Fix crash if document is malformed (too wide)
oss-fuzz/11195
diff --git a/splash/Splash.cc b/splash/Splash.cc
index 7964da3..bce1015 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -3337,7 +3337,12 @@
// allocate buffers
lineBuf = (Guchar *)gmalloc(srcWidth);
- pixBuf = (Guint *)gmallocn(srcWidth, sizeof(int));
+ pixBuf = (Guint *)gmallocn_checkoverflow(srcWidth, sizeof(int));
+ if (unlikely(!pixBuf)) {
+ error(errInternal, -1, "Couldn't allocate memory for pixBux in Splash::scaleMaskYdXd");
+ gfree(lineBuf);
+ return;
+ }
// init y scale Bresenham
yt = 0;