From 99c4da2f9ef86e345ee02cecb10e0df8f5e5b2e2 Mon Sep 17 00:00:00 2001 From: Luigi Toscano Date: Sun, 15 Jul 2012 21:15:43 +0200 Subject: [PATCH] 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 --- generators/dvi/TeXFont_PFB.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generators/dvi/TeXFont_PFB.cpp b/generators/dvi/TeXFont_PFB.cpp index cc866310a..6b2709361 100644 --- a/generators/dvi/TeXFont_PFB.cpp +++ b/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)