From 0c0e7e16a85e06694ad9d8e008fed567182e503f Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Sat, 9 Nov 2024 09:01:10 +0000 Subject: [PATCH] Be more careful when adding delta --- src/hb/ot_layout_gsubgpos.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb/ot_layout_gsubgpos.rs b/src/hb/ot_layout_gsubgpos.rs index 02919538..c632361f 100644 --- a/src/hb/ot_layout_gsubgpos.rs +++ b/src/hb/ot_layout_gsubgpos.rs @@ -928,7 +928,7 @@ fn apply_lookup( // // It should be possible to construct tests for both of these cases. - end = (end as isize + delta) as _; + end = end.saturating_add_signed(delta); if end < match_positions[idx] { // End might end up being smaller than match_positions[idx] if the recursed // lookup ended up removing many items.