From 1e9e344b2ba076a5fd6d57d1705e17a59c3875ce Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 17 Jul 2018 19:17:59 +0200 Subject: [PATCH] Fix hb_face_count() sanitize referencing --- src/hb-face.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hb-face.cc b/src/hb-face.cc index 2fef09d03..3c22f654f 100644 --- a/src/hb-face.cc +++ b/src/hb-face.cc @@ -52,10 +52,13 @@ hb_face_count (hb_blob_t *blob) if (unlikely (!blob)) return 0; - hb_blob_t *sanitized = OT::Sanitizer ().sanitize (blob); + /* TODO We shouldn't be sanitizing blob. Port to run sanitizer and return if not sane. */ + hb_blob_t *sanitized = OT::Sanitizer ().sanitize (hb_blob_reference (blob)); const OT::OpenTypeFontFile& ot = *sanitized->as (); + unsigned int ret = ot.get_face_count (); + hb_blob_destroy (sanitized); - return ot.get_face_count (); + return ret; } /*