From 0e5bcdef7fb592f986ad5b4e07b80d2efb5e3344 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 23 Oct 2018 00:39:44 -0700 Subject: [PATCH] [morx] Clear stack upon underflow when acting ligatures --- src/hb-aat-layout-morx-table.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index ddb444c21..3f5f29d1d 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -402,7 +402,11 @@ struct LigatureSubtable do { if (unlikely (!cursor)) + { + /* Stack underflow. Clear the stack. */ + match_length = 0; break; + } buffer->move_to (match_positions[--cursor]);