freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] parthw-cleaned 2097c52: [gf] Fix invalid free operation.


From: Parth Wazurkar
Subject: [freetype2] parthw-cleaned 2097c52: [gf] Fix invalid free operation.
Date: Sun, 12 Aug 2018 13:20:44 -0400 (EDT)

branch: parthw-cleaned
commit 2097c52603bf2994e6cd55312a029a36d54ac279
Author: Parth Wazurkar <address@hidden>
Commit: Parth Wazurkar <address@hidden>

    [gf] Fix invalid free operation.
    
    * src/gf/gfdrivr.c(GF_Face_Done): Fix the free operation
    which caused seg fault after `gf driver' returned `not a gf file'.
---
 src/gf/gfdrivr.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gf/gfdrivr.c b/src/gf/gfdrivr.c
index 8803bc2..ba6d505 100644
--- a/src/gf/gfdrivr.c
+++ b/src/gf/gfdrivr.c
@@ -190,7 +190,9 @@
     memory = FT_FACE_MEMORY( face );
 
     FT_FREE( gfface->available_sizes );
-    FT_FREE( face->gf_glyph->encodings );
+
+    if( face->gf_glyph )
+      FT_FREE( face->gf_glyph->encodings );
 
     gf_free_font( face );
 
@@ -238,7 +240,7 @@
       goto Exit;
 
     /* we have a gf font: let's construct the face object */
-    face->gf_glyph = go ;
+    face->gf_glyph = go;
 
     /* sanity check */
     if ( !face->gf_glyph->bm_table )



reply via email to

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