[serialize] Fix offset calculation
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 17 Apr 2019 21:59:39 +0000 (17:59 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 17 Apr 2019 21:59:39 +0000 (17:59 -0400)
src/hb-serialize.hh

index 971359f..311eacf 100644 (file)
@@ -272,7 +272,7 @@ struct hb_serialize_context_t
 
     auto& link = *current->links.push ();
     link.is_wide = sizeof (T) == 4;
-    link.position = (const char *) &ofs - (const char *) base;
+    link.position = (const char *) &ofs - current->head;
     link.bias = (const char *) base - current->head;
     link.objidx = objidx;
   }