Comment 5 for bug 181650

Revision history for this message
In , Arnaud Renevier (arenevier) wrote : Re: segfaults (in T1_GetFontBBox () from /usr/lib/libt1.so.5)

I think the bug occurs because, in your pdf file, embedded font
HelveticaNeue-H75 does not define FontBBox in its FontFile.

So, in T1_GetFontBBox, a crash occurs at
obj =
&(pFontBase->pFontArray[FontID].pType1Data->fontInfoP[FONTBBOX].value.data.arrayP[0]);
(because
pFontBase->pFontArray[FontID].pType1Data->fontInfoP[FONTBBOX].value.data.arrayP
is still NULL)

I also investigated to find if other unspecified properties could cause
other crashes, and discovered that if Encoding is not set, t1lib also
crashed (in T1_LoadFont) because of that line.

 if (strcmp( (char
     *)pFontBase->pFontArray[FontID].pType1Data->fontInfoP[ENCODING].value.data.arrayP[i].data.arrayP,

you can reproduce that bug by editing /usr/share/fonts/type1/gsfonts/n019003l.pfb
and replacing
/Encoding StandardEncoding def
with
/Ancoding StandardEncoding def
(don't modify file length though)
and launching attached pdf genplano.pdf.bz2 (or any other pdf using
that font)

I attach a patch (for t1lib-5.1.0 or t1lib-5.1.1), to set default values
to fontbbox ([0 0 0 0]) and encoding (StandardEncoding) if they are not
defined in font file, but I don't known if it's a good idea, or if it
would be preferable to stop processing and to return an error.

arno

reassign 313236 t1lib
--