Fix blob refcounting with insane SFNT table directories
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 22 Sep 2010 21:37:02 +0000 (17:37 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 22 Sep 2010 21:37:02 +0000 (17:37 -0400)
src/hb-font.cc

index a1535f1..8a547a3 100644 (file)
@@ -312,9 +312,7 @@ hb_face_t *
 hb_face_create_for_data (hb_blob_t    *blob,
                         unsigned int  index)
 {
-  hb_blob_reference (blob);
-  hb_face_for_data_closure_t *closure = _hb_face_for_data_closure_create (Sanitizer<OpenTypeFontFile>::sanitize (blob), index);
-  hb_blob_destroy (blob);
+  hb_face_for_data_closure_t *closure = _hb_face_for_data_closure_create (Sanitizer<OpenTypeFontFile>::sanitize (hb_blob_reference (blob)), index);
 
   if (unlikely (!closure))
     return &_hb_face_nil;