[vlc-commits] text_renderer: freetype: missing alloc check

Francois Cartegnie git at videolan.org
Wed Jan 15 15:11:24 CET 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jan 14 10:03:29 2020 +0100| [f81228b126789c26c9ee50792848da8ce7ef582e] | committer: Francois Cartegnie

text_renderer: freetype: missing alloc check

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

 modules/text_renderer/freetype/platform_fonts.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/text_renderer/freetype/platform_fonts.c b/modules/text_renderer/freetype/platform_fonts.c
index d2f2c7def3..809d06c648 100644
--- a/modules/text_renderer/freetype/platform_fonts.c
+++ b/modules/text_renderer/freetype/platform_fonts.c
@@ -240,9 +240,10 @@ vlc_family_t *NewFamily( filter_t *p_filter, const char *psz_family,
                          const char *psz_key )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
-    vlc_family_t *p_family = NULL;
 
-    p_family = calloc( 1, sizeof( *p_family ) );
+    vlc_family_t *p_family = calloc( 1, sizeof( *p_family ) );
+    if( unlikely(!p_family) )
+        return NULL;
 
     char *psz_name;
     if( psz_family && *psz_family )



More information about the vlc-commits mailing list