summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Pratta Teodosio <nathan.teodosio@canonical.com>2022-06-21 08:47:14 -0300
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2022-06-24 19:42:15 +0200
commit71fb0151f985924af60c383331b214a5a27790a5 (patch)
tree0c4ebf7d897f7da0b90550cd5140d646e6823e8e
parentUpdate for Poppler 22.06 (diff)
downloadcore-71fb0151f985924af60c383331b214a5a27790a5.tar.gz
core-71fb0151f985924af60c383331b214a5a27790a5.zip
Follow-up for Poppler 22.06 update
Change-Id: I8ee9f1a53cc4389e6a4d44e9765b478b5edfffd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136342 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit ad1ffc62e40c2409b610dfff25a8483b1f2556ad) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136382 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r--sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index d9efa39d8a54..f12478cb2f4d 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -476,10 +476,10 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* gfxFont, const GfxState* st
// we must write byte count to stdout before
#if POPPLER_CHECK_VERSION(22, 6, 0)
std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
- nSize = pBuf->size();
- if ( nSize > 0 )
+ if ( pBuf )
{
aNewFont.isEmbedded = true;
+ nSize = pBuf->size();
}
#else
char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
@@ -503,7 +503,8 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) const
int nSize = 0;
#if POPPLER_CHECK_VERSION(22, 6, 0)
std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
- nSize = pBuf->size();
+ if ( pBuf )
+ nSize = pBuf->size();
if ( nSize == 0 )
return;
#else