freetype-devel
[Top][All Lists]
Advanced

[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: Tue, 18 Oct 2005 01:31:42 +0300
User-agent: Mutt/1.4.2i

On Tue, Oct 18, 2005 at 12:58:41AM +0300, Ville Syrjälä wrote:
> On Mon, Oct 17, 2005 at 11:18:35PM +0200, David Turner wrote:
> > Hello,
> > 
> > thanks, I've commited a fix, which is to never call FT_New_GlyphSlot and 
> > FT_New_Size
> > within FT_Open_Face when face_index is < 0.
> > 
> > Hope this helps,
> 
> It works. Thanks.

It looks like the current code will leak memory though. AFAICS it needs 
something like this:

--- ftobjs.c.orig       2005-10-18 01:20:51.000000000 +0300
+++ ftobjs.c    2005-10-18 01:20:38.000000000 +0300
@@ -1751,8 +1751,11 @@
       internal->transform_delta.y = 0;
     }

-    if ( aface )
+    if ( face_index >= 0 )
       *aface = face;
+    else
+      FT_Done_Face( face );
+
     goto Exit;

   Fail:

-- 
Ville Syrjälä
address@hidden
http://www.sci.fi/~syrjala/




reply via email to

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