tdf#162887 sdext.pdfimport: Fix tilingPatternFill crash

regression from
  commit 8ac5f40b33
  Author: Dr. David Alan Gilbert <dave@treblig.org>
  tdf#113050 sdext.pdfimport: Write the tiling pattern image

The logo in the test file in tdf#159115 appears to be a tiling pattern
fill where the fill is actually rendered text (instead of just an image)
and this triggers splash to try and look at it's font code (even though
I've already got EnableFreeType off) and that was initialised by
startDoc which I'd failed to call.  Call it.

Note this doesn't fix tdf#159115, which originally had 4 copies of the
logo, the current state is it has one unrendered white blob, but lets
get rid of the crash first.

Change-Id: I4e3f29cedcb8aefbb5adf96f696bf08457fbd58a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173139
Tested-by: Hossein   <hossein@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Hossein   <hossein@libreoffice.org>
This commit is contained in:
Dr. David Alan Gilbert 2024-09-10 13:11:10 +01:00 committed by Hossein
parent 29fd68bb68
commit aec41175e8

View file

@ -1262,6 +1262,7 @@ poppler_bool PDFOutDev::tilingPatternFill(GfxState *state, Gfx *, Catalog *,
auto pSplashGfxState = new GfxState(nDPI, nDPI, &aBox, 0, false);
auto pSplashOut = new SplashOutputDev(splashModeRGB8, 1, false, nullptr);
pSplashOut->setEnableFreeType(false);
pSplashOut->startDoc(m_pDoc);
pSplashOut->startPage(0 /* pageNum */, pSplashGfxState, nullptr /* xref */);
auto pSplashGfx = new Gfx(m_pDoc, pSplashOut, pResDict, &aBox, nullptr);