[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: |
Turner, David |
Subject: |
RE: [ft-devel] Segfault with otf and face_index == -1 |
Date: |
Fri, 21 Oct 2005 09:24:22 +0200 |
Please forget what I've said, the function shouldn't return a valid
FT_Face when used with face_index < 0.
I was mistaken, I'll apply the first patch that corrects the memory
leak.
Thanks
- David Turner
- The FreeType Project (www.freetype.org)
> -----Message d'origine-----
> De : address@hidden
> [mailto:address@hidden
> la part de
> Ville Syrjälä
> Envoyé : vendredi 21 octobre 2005 00:31
> À : David Turner; address@hidden
> Objet : Re: [ft-devel] Segfault with otf and face_index == -1
>
>
> 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/
>
>
> _______________________________________________
> Freetype-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/freetype-devel
>
***********************************************************************************
Information contained in this email message is confidential and may be
privileged, and is intended only for use of the individual or entity named
above. If the reader of this message is not the intended recipient, or the
employee or agent responsible to deliver it to the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this communication
in error, please immediately notify the address@hidden and destroy the original
message.
***********************************************************************************
- RE: [ft-devel] Segfault with otf and face_index == -1,
Turner, David <=