diff options
author | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2024-01-13 21:40:09 +0100 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2024-01-13 23:52:08 +0100 |
commit | 1637610478c4493c29a29286b66250ef47507681 (patch) | |
tree | 86945dd1d62bee17c74c21bde3d283475a0bce3a /sdext/source | |
parent | 0cfb4aa2623b1606bbc66ef16256315778143227 (diff) |
Fix obscure xpdfimport crash on missing fonts
Invert logic, such that the case WMode == 0 and no font set now run
the former else branch. Happened here for an obscure pdf I was missing
some fonts for.
Change-Id: I2825c914a04f6a95d459eeeffb8091ed8f1819dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162029
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sdext/source')
-rw-r--r-- | sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx index 3ad139b65fa3..2517618e1019 100644 --- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx +++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx @@ -956,18 +956,18 @@ void PDFOutDev::drawChar(GfxState *state, double x, double y, double csdx = 0.0; double csdy = 0.0; - if (state->getFont()->getWMode()) + if (!state->getFont() || !state->getFont()->getWMode()) { - csdy = state->getCharSpace(); + csdx = state->getCharSpace(); if (*u == ' ') - csdy += state->getWordSpace(); + csdx += state->getWordSpace(); + csdx *= state->getHorizScaling(); } else { - csdx = state->getCharSpace(); + csdy = state->getCharSpace(); if (*u == ' ') - csdx += state->getWordSpace(); - csdx *= state->getHorizScaling(); + csdy += state->getWordSpace(); } double cstdx = 0.0; |