From dfd234a97d2e2f9908eaf0598de765f76ba86c82 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Thu, 26 Oct 2017 16:59:50 +0100 Subject: [PATCH] [set] Fix page_map[] indexing in backward loop. Fixes https://github.com/behdad/harfbuzz/issues/579. --- src/hb-set-private.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-set-private.hh b/src/hb-set-private.hh index df4325afd..c970b89dd 100644 --- a/src/hb-set-private.hh +++ b/src/hb-set-private.hh @@ -313,13 +313,13 @@ struct hb_set_t b = nb; for (; a && b; ) { - if (page_map[a].major == other->page_map[b].major) + if (page_map[a - 1].major == other->page_map[b - 1].major) { a--; b--; Op::process (page_at (--count).v, page_at (a).v, other->page_at (b).v); } - else if (page_map[a].major > other->page_map[b].major) + else if (page_map[a - 1].major > other->page_map[b - 1].major) { a--; if (Op::passthru_left)