Commit a874c7ecca00b9a2b228537685a5aa4427e00b99

suzuki toshiya 2010-07-04T12:08:41

Check error value by `FT_CMap_New'. * src/cff/cffobjs.c (cff_face_init): Check error value by `FT_CMap_New'. * src/pfr/pfrobjs.c (pfr_face_init): Ditto. * src/type1/t1jobjs.c (T1_Face_Init): Ditto. * src/type42/t42jobjs.c (T42_Face_Init): Ditto.

diff --git a/ChangeLog b/ChangeLog
index 189b79b..0b4b436 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+	Check error value by `FT_CMap_New'.
+
+	* src/cff/cffobjs.c (cff_face_init): Check error value by
+	`FT_CMap_New'.
+	* src/pfr/pfrobjs.c (pfr_face_init): Ditto.
+	* src/type1/t1jobjs.c (T1_Face_Init): Ditto.
+	* src/type42/t42jobjs.c (T42_Face_Init): Ditto.
+
 2010-07-03  Werner Lemberg  <wl@gnu.org>
 
 	Make ftgrays.c compile stand-alone again.
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 4dc78bc..f7b5e8b 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -887,7 +887,10 @@
 
         nn = (FT_UInt)cffface->num_charmaps;
 
-        FT_CMap_New( &FT_CFF_CMAP_UNICODE_CLASS_REC_GET, NULL, &cmaprec, NULL );
+        error = FT_CMap_New( &FT_CFF_CMAP_UNICODE_CLASS_REC_GET, NULL,
+                             &cmaprec, NULL );
+        if ( error )
+          goto Exit;
 
         /* if no Unicode charmap was previously selected, select this one */
         if ( cffface->charmap == NULL && nn != (FT_UInt)cffface->num_charmaps )
@@ -921,7 +924,7 @@
             clazz               = &FT_CFF_CMAP_ENCODING_CLASS_REC_GET;
           }
 
-          FT_CMap_New( clazz, NULL, &cmaprec, NULL );
+          error = FT_CMap_New( clazz, NULL, &cmaprec, NULL );
         }
       }
     }
diff --git a/src/pfr/pfrobjs.c b/src/pfr/pfrobjs.c
index 40b1463..73afb59 100644
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -256,7 +256,7 @@
         charmap.encoding_id = 1;
         charmap.encoding    = FT_ENCODING_UNICODE;
 
-        FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL );
+        error = FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL );
 
 #if 0
         /* Select default charmap */
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index b1de687..1183b42 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -498,7 +498,9 @@
         charmap.encoding_id = 1;
         charmap.encoding    = FT_ENCODING_UNICODE;
 
-        FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
+        error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
+        if ( error )
+          goto Exit;
 
         /* now, generate an Adobe Standard encoding when appropriate */
         charmap.platform_id = 7;
@@ -535,7 +537,7 @@
         }
 
         if ( clazz )
-          FT_CMap_New( clazz, NULL, &charmap, NULL );
+          error = FT_CMap_New( clazz, NULL, &charmap, NULL );
 
 #if 0
         /* Select default charmap */
diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c
index 9081ffc..de88465 100644
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -334,7 +334,9 @@
         charmap.encoding_id = 1;
         charmap.encoding    = FT_ENCODING_UNICODE;
 
-        FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
+        error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
+        if ( error )
+          goto Exit;
 
         /* now, generate an Adobe Standard encoding when appropriate */
         charmap.platform_id = 7;
@@ -371,7 +373,7 @@
         }
 
         if ( clazz )
-          FT_CMap_New( clazz, NULL, &charmap, NULL );
+          error = FT_CMap_New( clazz, NULL, &charmap, NULL );
 
 #if 0
         /* Select default charmap */