diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-08-28 21:07:05 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-08-29 08:37:24 +0200 |
commit | b4c003397eb29beff055044091c1d088acda2bae (patch) | |
tree | b4bda3cef448e6dabfeb03a71e290a90a9eb4a49 /svx/source | |
parent | 60362accc78fdff4213fa6c28bb4fbf00e06972f (diff) |
pdfium: replace FPDFTextObj_GetFontName() patch with backport
Change-Id: I36d86e7ccca66b09f2f49e401d77deb52fbf742a
Reviewed-on: https://gerrit.libreoffice.org/59738
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/svdraw/svdpdf.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 8faf9c6649eb..88e157b696fb 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -853,10 +853,11 @@ void ImpSdrPdfImport::ImportText(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTex mbFntDirty = true; } - std::unique_ptr<char[]> pFontName(new char[80 + 1]); // + terminating null + const int nFontName = 80 + 1; + std::unique_ptr<char[]> pFontName(new char[nFontName]); // + terminating null char* pCharFontName = reinterpret_cast<char*>(pFontName.get()); - int nFontNameChars = FPDFTextObj_GetFontName(pPageObject, pCharFontName); - if (nFontNameChars > 0) + int nFontNameChars = FPDFTextObj_GetFontName(pPageObject, pCharFontName, nFontName); + if (nFontName >= nFontNameChars) { OUString sFontName = OUString::createFromAscii(pFontName.get()); if (sFontName != aFnt.GetFamilyName()) |