[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] Segfault with otf and face_index == -1
From: |
Ville Syrjälä |
Subject: |
Re: [ft-devel] Segfault with otf and face_index == -1 |
Date: |
Fri, 21 Oct 2005 01:30:51 +0300 |
User-agent: |
Mutt/1.4.2i |
On Tue, Oct 18, 2005 at 01:44:43AM +0300, Ville Syrjälä wrote:
> On Tue, Oct 18, 2005 at 12:36:57AM +0200, David Turner wrote:
> > Hi Again,
> >
> > no, this is on purpose. If you call FT_New_Face with face_index < 0, it
> > should return an empty FT_Face object to indicate that the format is
> > supported
> > (otherwise, an error is returned).
> >
> > Moreover, the face->num_faces field can be used to determine the number
> > of faces within the font file.
> >
> > After that, the caller must destroy the FT_Face normally with FT_Done_Face
>
> Ok. You should update the API docs to refelct that. Currently they state
> that with face_index < 0 no face handle is returned. Also the current code
> allows you to pass face_index < 0 and aface == NULL. If that is still
> legal then the following patch is needed to avoid leaks ...I think :)
>
> --- ftobjs.c.orig 2005-10-18 01:20:51.000000000 +0300
> +++ ftobjs.c 2005-10-18 01:43:52.000000000 +0300
> @@ -1753,6 +1753,9 @@
>
> if ( aface )
> *aface = face;
> + else
> + FT_Done_Face( face );
> +
> goto Exit;
>
> Fail:
>
No comments?
--
Ville Syrjälä
address@hidden
http://www.sci.fi/~syrjala/