[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Devel] CVT leak ?
From: |
Nir Rostoker |
Subject: |
[Devel] CVT leak ? |
Date: |
Sun, 26 May 2002 19:22:52 +0300 |
Hi !
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 ?
Thanks,
Nir
- [Devel] CVT leak ?,
Nir Rostoker <=