From 361fc2686152ad8c0ebaf19e0522e0fc58ba3953 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Sep 2018 16:47:33 +0200 Subject: [PATCH] Fix OffsetTo::sanitize() after reshuffling --- src/hb-open-type.hh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 3926694b0..973dc5e11 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -274,7 +274,8 @@ struct OffsetTo : Offset { TRACE_SANITIZE (this); return_trace (sanitize_shallow (c, base) && - (StructAtOffset (base, *this).sanitize (c) || + (!*this || + StructAtOffset (base, *this).sanitize (c) || neuter (c))); } template @@ -282,7 +283,8 @@ struct OffsetTo : Offset { TRACE_SANITIZE (this); return_trace (sanitize_shallow (c, base) && - (StructAtOffset (base, *this).sanitize (c, d1) || + (!*this || + StructAtOffset (base, *this).sanitize (c, d1) || neuter (c))); } template @@ -290,7 +292,8 @@ struct OffsetTo : Offset { TRACE_SANITIZE (this); return_trace (sanitize_shallow (c, base) && - (StructAtOffset (base, *this).sanitize (c, d1, d2) || + (!*this || + StructAtOffset (base, *this).sanitize (c, d1, d2) || neuter (c))); } template @@ -298,7 +301,8 @@ struct OffsetTo : Offset { TRACE_SANITIZE (this); return_trace (sanitize_shallow (c, base) && - (StructAtOffset (base, *this).sanitize (c, d1, d2, d3) || + (!*this || + StructAtOffset (base, *this).sanitize (c, d1, d2, d3) || neuter (c))); }