freetype-commit
[Top][All Lists]
Advanced

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

[freetype2-demos] master 8dd7c5f: * src/ftmulti.c (main): Fix double-fre


From: Werner LEMBERG
Subject: [freetype2-demos] master 8dd7c5f: * src/ftmulti.c (main): Fix double-free in case of invalid font.
Date: Tue, 04 Aug 2015 07:52:04 +0000

branch: master
commit 8dd7c5f5e5de2ef07e9be7454f9e0fbab42e97ba
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    * src/ftmulti.c (main): Fix double-free in case of invalid font.
---
 ChangeLog     |    4 ++++
 src/ftmulti.c |    6 ++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 286f093..e84b02f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-08-04  Werner Lemberg  <address@hidden>
+
+       * src/ftmulti.c (main): Fix double-free in case of invalid font.
+
 2015-07-08  Werner Lemberg  <address@hidden>
 
        [ftcommon] Improve loading of font collections.
diff --git a/src/ftmulti.c b/src/ftmulti.c
index 77c9c7a..eff0bc4 100644
--- a/src/ftmulti.c
+++ b/src/ftmulti.c
@@ -792,7 +792,10 @@
     /* Load face */
     error = FT_New_Face( library, argv[file], 0, &face );
     if ( error )
+    {
+      face = NULL;
       goto Display_Font;
+    }
 
     if ( encoding != FT_ENCODING_NONE )
     {
@@ -804,7 +807,10 @@
     /* retrieve multiple master information */
     error = FT_Get_MM_Var( face, &multimaster );
     if ( error )
+    {
+      multimaster = NULL;
       goto Display_Font;
+    }
 
     /* if the user specified a position, use it, otherwise */
     /* set the current position to the median of each axis */



reply via email to

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