From 2eaf482b371034ce6ebfaedee98049b036fd3493 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 9 Aug 2012 18:30:05 -0400 Subject: [PATCH] Revert "[GSUB/GPOS] Reject Context/ChainContext lookups with zero input" This reverts commit 0981068b75710397f08e0d2d776a0a2ea68d7117. I was confused. Even if we access coverage[0] unconditionally, we don't need bound checks since the array machinary already handles that. --- src/hb-ot-layout-gsubgpos-private.hh | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index fd5fb19f6..ba2a7e0e1 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -928,7 +928,6 @@ struct ContextFormat3 TRACE_SANITIZE (); if (!c->check_struct (this)) return TRACE_RETURN (false); unsigned int count = glyphCount; - if (unlikely (!glyphCount)) return TRACE_RETURN (false); if (!c->check_array (coverage, coverage[0].static_size, count)) return TRACE_RETURN (false); for (unsigned int i = 0; i < count; i++) if (!coverage[i].sanitize (c, this)) return TRACE_RETURN (false); @@ -1467,7 +1466,6 @@ struct ChainContextFormat3 if (!backtrack.sanitize (c, this)) return TRACE_RETURN (false); OffsetArrayOf &input = StructAfter > (backtrack); if (!input.sanitize (c, this)) return TRACE_RETURN (false); - if (unlikely (!input.len)) return TRACE_RETURN (false); OffsetArrayOf &lookahead = StructAfter > (input); if (!lookahead.sanitize (c, this)) return TRACE_RETURN (false); ArrayOf &lookup = StructAfter > (lookahead);