freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] [Fontconfig] fontconfig crash for special bdf font


From: Werner LEMBERG
Subject: Re: [ft-devel] [Fontconfig] fontconfig crash for special bdf font
Date: Wed, 29 Jan 2014 08:09:23 +0100 (CET)

> That prop.u.atom is the result of calling FT_BDF_Get_Property
> though, we are expecting to see the proper atom when prop.type is
> set to BDF_PROPERTY_TYPE_ATOM.  In this case IMHO prop.type should
> be set to BDF_PROPERTY_TYPE_NONE and returns an error.

Why?  The entry in the font causing the crash is is

  SETWIDTH_NAME ""

which is valid from a syntax point of view AFAICS, so returning an
error seems incorrect to me.

However: There is explicit code in FreeType's BDF handling which
prevents the creation of an empty string (cf. bdflib.c, line 1394),
thus NULL is a valid value for `prop.u.atom'.  Looking up the code I
see that this is a change from 2007, and before that change FreeType
indeed returned an empty string...

I see two possibilities on the FreeType side:

  1. Document that NULL is a valid return value for `atom',
     corresponding to a property present in the font with a zero
     string as an argument – the return value
     `FT_Err_Invalid_Argument' of function `FT_Get_BDF_Property'
     indicates that the searched property isn't present in the font.

  2. Change the code back to return an empty string.

I tend to solution 1, but I'm open to other suggestions.


    Werner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]