diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc index 9e07060..1ba4d52 100644 --- a/poppler/SplashOutputDev.cc +++ b/poppler/SplashOutputDev.cc @@ -3947,6 +3947,7 @@ GBool SplashOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx1, Catalog *ca Matrix m1; double *ctm, savedCTM[6]; double kx, ky, sx, sy; + GBool retValue = gFalse; width = bbox[2] - bbox[0]; height = bbox[3] - bbox[1]; @@ -4012,6 +4013,10 @@ GBool SplashOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx1, Catalog *ca m1.m[3] /= 2; m1.transform(width, height, &kx, &ky); } + while(result_width > formerBitmap->getWidth() ||result_height > formerBitmap->getHeight()) { + result_width >>= 1; + result_height >>= 1; + } surface_width = (int) ceil (fabs(kx)); surface_height = (int) ceil (fabs(ky)); // adjust repeat values to completely fill region @@ -4091,10 +4096,11 @@ GBool SplashOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx1, Catalog *ca matc[1] = ctm[1]; matc[2] = ctm[2]; matc[3] = ctm[3]; - splash->drawImage(&tilingBitmapSrc, &imgData, colorMode, gTrue, result_width, result_height, matc, gTrue); + retValue = splash->drawImage(&tilingBitmapSrc, &imgData, colorMode, gTrue, result_width, result_height, matc, gTrue) + == splashOk; delete tBitmap; delete gfx; - return gTrue; + return retValue; } GBool SplashOutputDev::gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading)