When running pdftoppm -r72 -mono over https://bugs.kde.org/attachment.cgi?id=11961 it crashes when creating the SplashBitmap. The obvious solution is changing if (rowSize > 0) { rowSize += rowPad - 1; rowSize -= rowSize % rowPad; } to if (rowSize > 0 && rowPad > 0) { rowSize += rowPad - 1; rowSize -= rowSize % rowPad; } But i'm creating this bug to get Thomas' opinion on it
So, Thomas, what's your opinion?
First of all, a rowPad of 0 doesn't make any sense (rowPad of 1 means byte boundary, what should then be a rowPad = 0), so the error is in (my) SplashOutputDev::tilingPatternFill, it should be bitmap = new SplashBitmap(surface_width, surface_height, 1, (paintType == 1) ? colorMode : splashModeMono8, gTrue); instead of bitmap = new SplashBitmap(surface_width, surface_height, colorMode != splashModeMono1, (paintType == 1) ? colorMode : splashModeMono8, gTrue); (who ever insert this curious code :-) ) But because rowPad is a parameter of SplashoutputDev, and anybody can make the same mistake than I, it's probably a good idea to avoid dividing by 0. But I would then change it to if (rowSize > 0 && rowPad > 1) { rowSize += rowPad - 1; rowSize -= rowSize % rowPad; } (why calling statements which change nothing in case of rowPad = 1)
In the quest for the smallest change i've just changed the first (i.e. colorMode != splashModeMono1 -> 1) in the "new SplashBitmap"
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.