[vlc-commits] freetype: fix memory leak when dealing with empty texts

Hannes Domani git at videolan.org
Fri Feb 26 18:02:03 CET 2016


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Fri Feb 26 17:49:15 2016 +0100| [bc1ee6cf54b95b213f2ba7baccd47c7acffd2424] | committer: Jean-Baptiste Kempf

freetype: fix memory leak when dealing with empty texts

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bc1ee6cf54b95b213f2ba7baccd47c7acffd2424
---

 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 );



More information about the vlc-commits mailing list