freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] CVT leak ?


From: Tom Kacvinsky
Subject: Re: [Devel] CVT leak ?
Date: Sun, 26 May 2002 13:26:53 -0400

Do you suffer any segmatation viloations or other memory trashing when
doing this?  If so, would you send me a font for which this problem
occurs?

Thanks,

Tom

On 2002/05/26 at 19:22, Nir Rostoker <address@hidden> wrote:

> 
> I'm using FT version 2.09 and I have noticed that there might be a
> problem when using the CVT table (in those fonts which needs it).
> 
> Face->cvt is defined as FT_Long*. However when allocating memory for
> it there seem to be an allocation for UShort:
> 
> if ( ALLOC_ARRAY( face->cvt,
>                       face->cvt_size,
>                       FT_Short ) )
> 
> 
> When reading the values to this allocated CVT table, Short values are
> being loaded:
> 
>      FT_Short*  cur   = face->cvt;
>       FT_Short*  limit = cur + face->cvt_size;
> 
> 
>       for ( ; cur <  limit; cur++ )
>         *cur = GET_Short();
> 
> 
> And much worse, when accessing face->cvt in Reset_Outline_Size
> function, the CVT array is being addressed by index as if it is a
> FT_Long array (there is no casting to FT_Short) while its limit
> (cvt_size) is equal to the size of  face->cvt in shorts, so actually
> when I is bigger than cvt_size/2, the data of CVT[i] is not from the
> CVT table ...
> 
> 
>  for ( i = 0; i < size->cvt_size; i++ )
>         size->cvt[i] = FT_MulFix( GetCVT( face , i),
>                                   size->ttmetrics.scale
>                                 );
> 
> Are you aware of it ? 
> 



reply via email to

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