freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] Memory leak in cff fonts


From: Boris Letocha
Subject: [ft-devel] Memory leak in cff fonts
Date: Mon, 5 Jun 2006 12:44:22 +0200

Hello all,

I think that there is memory leak in CFF font handling (FreeType 2.2.1).
Could be seen for example in attached font.
Look at psmodule.c, method ps_unicodes_init
 const char*  gname = get_glyph_name( glyph_data, n );
this gname is not deleted, problem is that is should be deleted only in
case of cff font and not in type1 fonts.

In cff fonts get_glyph_name callback points to:
cff_sid_to_glyph_name from cffcmap.c
which calls:
cff_index_get_sid_string which allways create new string in memory.

In type1 fonts get_glyph_name callback points to:
t1_get_glyph_name from t1cmap.c
which just returns face->type1.glyph_names[idx] - so it could not be
deleted.

I don't see any easy fix, so please find out one yourself :-) (I will
fix it temporary to create copy even in t1_get_glyph_name and free it in
ps_unicodes_init always.

Regards,

Boris Letocha

Attachment: F2.cff
Description: F2.cff


reply via email to

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