[vlc-devel] [PATCH 1/7] freetype: fix memory leak when dealing with empty texts

Hannes Domani ssbssa at yahoo.de
Fri Feb 26 17:49:15 CET 2016


---
 modules/text_renderer/freetype/freetype.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/text_renderer/freetype/freetype.c b/modules/text_renderer/freetype/freetype.c
index 3409460..135b411 100644
--- a/modules/text_renderer/freetype/freetype.c
+++ b/modules/text_renderer/freetype/freetype.c
@@ -988,7 +988,7 @@ static uni_char_t* SegmentsToTextAndStyles( filter_t *p_filter, const text_segme
     *pi_styles = 0;
     for( const text_segment_t *s = p_segment; s != NULL; s = s->p_next )
     {
-        if( !s->psz_text )
+        if( !s->psz_text || !s->psz_text[0] )
             continue;
         size_t i_string_bytes = 0;
         uni_char_t *psz_tmp = ToCharset( FREETYPE_TO_UCS, s->psz_text, &i_string_bytes );
-- 
2.7.1



More information about the vlc-devel mailing list