Let hb_face_get_table() return NULL if table not found
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 20 May 2010 17:33:35 +0000 (18:33 +0100)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 20 May 2010 17:33:35 +0000 (18:33 +0100)
src/hb-font.cc
src/hb-font.h
src/hb-open-type-private.hh

index 93787c00f59a603d7faa94dea821f805dc2ab0ea..a55deb34863f9f0a1f49a8d65c66e459c613227f 100644 (file)
@@ -364,7 +364,7 @@ hb_face_get_table (hb_face_t *face,
 
   blob = face->get_table (tag, face->user_data);
 
-  return likely (blob) ? blob : &_hb_blob_nil;
+  return blob;
 }
 
 
index 433d31a3b01c6ba82fb28b8afe96ab1d542aebe7..89324faa20aa61485ecd832b09c026b9f2a236dd 100644 (file)
@@ -60,6 +60,7 @@ hb_face_get_reference_count (hb_face_t *face);
 void
 hb_face_destroy (hb_face_t *face);
 
+/* Returns NULL if not found */
 hb_blob_t *
 hb_face_get_table (hb_face_t *face,
                   hb_tag_t   tag);
index 2ab639c4cacec18c9a834e14cfed32453366372d..d2fbb2101005a7d3f8c462d6a645f680c41f2b3e 100644 (file)
@@ -283,6 +283,9 @@ struct Sanitizer
 
     /* TODO is_sane() stuff */
 
+    if (!blob)
+      return hb_blob_create_empty ();
+
   retry:
     if (HB_DEBUG_SANITIZE)
       fprintf (stderr, "Sanitizer %p start %s\n", blob, HB_FUNC);