Don't fail sanitize on NULL data
authorBehdad Esfahbod <behdad@behdad.org>
Tue, 11 May 2010 00:07:56 +0000 (20:07 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Tue, 11 May 2010 00:07:56 +0000 (20:07 -0400)
src/hb-open-type-private.hh

index 3f05bf7..c7b087e 100644 (file)
@@ -290,6 +290,11 @@ struct Sanitizer
 
     context->init (blob);
 
+    if (unlikely (!context->start)) {
+      context->finish ();
+      return blob;
+    }
+
     Type *t = CastP<Type> (const_cast<char *> (context->start));
 
     sane = t->sanitize (context);