freetype-devel
[Top][All Lists]
Advanced

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

RE: [Devel] bug in 2.1.7


From: Turner David
Subject: RE: [Devel] bug in 2.1.7
Date: Tue, 2 Mar 2004 14:11:26 +0100

Hello,
Hi,
 
I just downloaded the 2.1.7 version from your site, and in base\ftobjs.c there is a bug that was introduced in ft_input_stream_new (the last version we used was 2.04).  If the user passes in his own stream and memory allocation functions (FT_OPEN_STREAM set), then the following line near the end of the function is incorrect:
 
stream->memory = memory;  /* just to be certain */
 
This line overwrites the client's memory object, which prevents the client from getting alloc & free callbacks, and causes a leak because the client's memory pointer is lost here.
 
This is not a bug, the memory allocator used by the stream must be the same than the
one used by the library itself. This is a design feature and won't change.
 
If you want to use a custom allocator, you shouldn't use FT_Init_FreeType, instead,
use something like the following:
 
#include FT_MODULE_H
 
... create FT_Memory instance, accessed with the "my_memory" pointer
 
// create new library object, this ones doesn't have any modules registered
error = FT_Library_New( my_memory, &library );
if (error) ....
 
// register all "static modules", determined by "ftmodule.h" configuration
FT_Add_Default_Modules( library );
 
Hope this helps,
 
- David Turner
- The FreeType Project  (www.freetype.org)
 
 
Best regards,
 
Neil Peterson (address@hiddendesign.com)
Open Design Alliance
 


This message and any attachments (the "message") is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accordance with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. The E-Mail transmission can not guarantee the integrity of this message.
NDS FRANCE will not therefore be liable for the message if modified.


reply via email to

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