minor; fixes #2292

This commit is contained in:
ariza 2020-04-01 19:49:18 -07:00
parent 014e038b2c
commit 65f4136303
1 changed files with 2 additions and 3 deletions

View File

@ -319,12 +319,11 @@ struct hb_serialize_context_t
{
const object_t* child = packed[link.objidx];
if (unlikely (!child)) { err_other_error(); return; }
unsigned offset;
switch ((whence_t)link.whence) {
unsigned offset = 0;
switch ((whence_t) link.whence) {
case Head: offset = child->head - parent->head; break;
case Tail: offset = child->head - parent->tail; break;
case Absolute: offset = (head - start) + (child->head - tail); break;
default: assert (0);
}
assert (offset >= link.bias);