Avoid crash when the font is broken.

The call to FT_New_Face takes the address of the 'face' variable, whose type is a
typedef *something TF_Face;
The value of TF_Face (so a pointer to the properly filled font structure) s then
replaced inside the call of TF_New_Face; but when the latter function fails,
the value of 'face' is not reset and this leads to a crash in the distructor of
TeXFont_PFB.
So properly initialize TF_Face to 0, its address is valid, and the code works.

BUG: 303472
FIXED-IN: 4.8.5
remotes/origin/KDE/4.10
Luigi Toscano 14 years ago
parent e90cec9625
commit 99c4da2f9e
  1. 2
      generators/dvi/TeXFont_PFB.cpp

@ -25,7 +25,7 @@
TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double slant)
: TeXFont(parent)
: TeXFont(parent), face(0)
{
#ifdef DEBUG_PFB
if (enc != 0)

Loading…
Cancel
Save