Hi,
I'm currently upgrading our emWin lib from 5.somthing to 6.34a and I have encountered an issue with FreeType library (ver. 2.12.1). I did manage to track the issue to an uninitialized variable. The variable is part of a heap-allocated structure, thus the initial value will be whatever is found on the heap. The "wrong" initial value will make the internal cache-system malfunction, causing a huge performance loss, the rendered text still looks OK though. My resolution was to simply add a line to initialize the variable (line 2370 in the source below). I did check the latest version of the FreeType lib (2.13.2) and the issue has been resolved by the FreeType crew somewhere along the way to version 2.13.2.
Regards,
- Martin
Display All
I'm currently upgrading our emWin lib from 5.somthing to 6.34a and I have encountered an issue with FreeType library (ver. 2.12.1). I did manage to track the issue to an uninitialized variable. The variable is part of a heap-allocated structure, thus the initial value will be whatever is found on the heap. The "wrong" initial value will make the internal cache-system malfunction, causing a huge performance loss, the rendered text still looks OK though. My resolution was to simply add a line to initialize the variable (line 2370 in the source below). I did check the latest version of the FreeType lib (2.13.2) and the issue has been resolved by the FreeType crew somewhere along the way to version 2.13.2.
Regards,
- Martin
C Source Code: ftcache.c
- FT_EXPORT_DEF( FT_Error )
- FTC_Manager_New( FT_Library library,
- FT_UInt max_faces,
- FT_UInt max_sizes,
- FT_ULong max_bytes,
- FTC_Face_Requester requester,
- FT_Pointer req_data,
- FTC_Manager *amanager )
- {
- FT_Error error;
- FT_Memory memory;
- FTC_Manager manager = NULL;
- if ( !library )
- return FT_THROW( Invalid_Library_Handle );
- if ( !amanager || !requester )
- return FT_THROW( Invalid_Argument );
- memory = library->memory;
- if ( FT_QNEW( manager ) )
- goto Exit;
- if ( max_faces == 0 )
- max_faces = FTC_MAX_FACES_DEFAULT;
- if ( max_sizes == 0 )
- max_sizes = FTC_MAX_SIZES_DEFAULT;
- if ( max_bytes == 0 )
- max_bytes = FTC_MAX_BYTES_DEFAULT;
- manager->library = library;
- manager->memory = memory;
- manager->max_weight = max_bytes;
- manager->cur_weight = 0; /* This line has been added! */
- manager->request_face = requester;
- manager->request_data = req_data;
- FTC_MruList_Init( &manager->faces,
- &ftc_face_list_class,
- max_faces,
- manager,
- memory );
- FTC_MruList_Init( &manager->sizes,
- &ftc_size_list_class,
- max_sizes,
- manager,
- memory );
- manager->nodes_list = NULL;
- manager->num_nodes = 0;
- manager->num_caches = 0;
- *amanager = manager;
- Exit:
- return error;
- }