Re: [ft-devel] missing out-of-memory check when creating family name for TrueType fonts

2008-11-07 Thread Werner LEMBERG

 The correct fix would be for tt_face_get_name and similar functions
 to return an error code as well as the face pointer.

I've implemented this in the CVS.  Please test.


Werner


___
Freetype-devel mailing list
Freetype-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype-devel


[ft-devel] missing out-of-memory check when creating family name for TrueType fonts

2008-11-05 Thread Graham Asher
Here's another problem caused by a missing out-of-memory check. The function


tt_face_get_name

in sfobjs.c is defined as returning NULL if no name is present, but also
returns NULL if the name is in fact present but there is no memory to
allocate a copy of the name. This ambiguity leads to FT_Open_Face and
associated functions seeming to succeed when in fact the face has not been
constructed correctly.

The correct fix would be for tt_face_get_name and similar functions to
return an error code as well as the face pointer. For the moment I have no
time to work out the correct set of patches, but I'll just put this on
record as a warning.

Callers should check whether face-family_name is null before using it; a
missing family name is likely to be an error although the API doesn't
actually tell us whether it is. 

Graham Asher




___
Freetype-devel mailing list
Freetype-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype-devel