freetype
[Top][All Lists]
Advanced

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

Re: [Freetype] Some odd problems, fixed


From: Werner LEMBERG
Subject: Re: [Freetype] Some odd problems, fixed
Date: Fri, 21 May 2004 18:33:47 +0200 (CEST)

Sorry for the late reply.  A virus has apparently disabled my
subscription of the freetype list...

> Below are my changes - they aren't in proper patch format, they
> don't use your indent style, and they're for 2.1.4 (2.1.8 is
> current, I think, but the gentoo portage entry is a bit slow.  Also
> - I've been using the vanilla freetype, not a gentoo-ised version.
> Looking in the CVS it seems my fixes still apply anyway).  But
> anyway - I'd be very happy if you could add my changes in somehow,
> so that next time I update my libraries, I won't have to add them in
> manually all over again.

You might try `valgrind' to find out where the problems really are.

> ftutil.c: ~120:
> 
>   FT_BASE_DEF( void )
>   FT_Free( FT_Memory memory, void** P ) {
>     FT_TRACE7(( "FT_Free:" ));
>     FT_TRACE7(( " Freeing block 0x%08p, ref 0x%08p\n", P, P ? *P : (void*)0 
> ));
>     
>     /*
>      * The func was getting called with P = 0x4, which isn't null, but
>      * isn't a valid address either
>      */
>     if ( P && (P > 0xFFFF && *P) ) {
>       memory->free( memory, *P );
>       *P = 0;
>     }
>   }

Uh, oh, I won't apply this.  This is special to PCs.  Your patch only
hides the real problem which must be somewhere else.

> ttcload.c: ~380:
> 
>       while ( flag < limit )
>       {
>         if ( --byte_len < 0 )
>           goto Invalid_Outline;
> 
>         if(flag == 0) return; /* sanity check */

The same here.  First, to check within the loop is expensive.  Second,
we never got a report that there is a problem at this very place --
`flag' (which is `outline->tags') is used at many other places also.
I rather think that GTK (or another application) corrupts memory so
that you get problems.

> ttgload.c: ~666:
> 
>       FT_Vector*  pp1;
>       FT_Vector*  pp2;
> 
>       if(!outline->points) return; /* sanity check */

I *might* add

  FT_ASSERT( outline->points );

but I wonder why I shall do so.  I can only repeat: Your patches hide
the real problems.  The next time you get a crash please provide some
debugging information.


    Werner



reply via email to

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