From ab16b24cc94389ac66a9353327d2a87a7c230ed4 Mon Sep 17 00:00:00 2001 From: Michiharu Ariza Date: Wed, 26 Sep 2018 18:51:36 -0700 Subject: [PATCH] tweaked get_fd fix --- src/hb-ot-cff-common.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index b036ae53f..32c83b0a0 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -572,11 +572,12 @@ struct FDSelect3_4 { inline hb_codepoint_t get_fd (hb_codepoint_t glyph) const { - for (unsigned int i = 1; i < nRanges; i++) + unsigned int i; + for (i = 1; i < nRanges; i++) if (glyph < ranges[i].first) - return (hb_codepoint_t)ranges[i - 1].fd; + break; - return (hb_codepoint_t)ranges[nRanges - 1].fd; + return (hb_codepoint_t)ranges[i - 1].fd; } inline GID_TYPE &sentinel (void) { return StructAfter (ranges[nRanges - 1]); }