shithub: freetype+ttf2subf

Download patch

ref: 71969d1edfac78f2bd2f76f0210848d124f38ed0
parent: 529158983ddde23ac422fc28939b0eb2bbaa04a1
author: Alexei Podtelezhnikov <[email protected]>
date: Mon Sep 20 10:31:45 EDT 2021

* src/cff/cffdrivr.c (cff_ps_get_font_{info,extra}): Use FT_QNEW.

git/fs: mount .git/fs: mount/attach disallowed
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -473,12 +473,12 @@
 
     if ( cff && !cff->font_info )
     {
-      CFF_FontRecDict  dict      = &cff->top_font.font_dict;
-      PS_FontInfoRec  *font_info = NULL;
-      FT_Memory        memory    = face->root.memory;
+      CFF_FontRecDict  dict   = &cff->top_font.font_dict;
+      FT_Memory        memory = face->root.memory;
+      PS_FontInfoRec*  font_info;
 
 
-      if ( FT_QALLOC( font_info, sizeof ( *font_info ) ) )
+      if ( FT_QNEW( font_info ) )
         goto Fail;
 
       font_info->version     = cff_index_get_sid_string( cff,
@@ -515,15 +515,15 @@
     FT_Error  error = FT_Err_Ok;
 
 
-    if ( cff && cff->font_extra == NULL )
+    if ( cff && !cff->font_extra )
     {
-      CFF_FontRecDict   dict       = &cff->top_font.font_dict;
-      PS_FontExtraRec*  font_extra = NULL;
-      FT_Memory         memory     = face->root.memory;
+      CFF_FontRecDict   dict   = &cff->top_font.font_dict;
+      FT_Memory         memory = face->root.memory;
+      PS_FontExtraRec*  font_extra;
       FT_String*        embedded_postscript;
 
 
-      if ( FT_ALLOC( font_extra, sizeof ( *font_extra ) ) )
+      if ( FT_QNEW( font_extra ) )
         goto Fail;
 
       font_extra->fs_type = 0U;