Skip to content

Commit

Permalink
Avoid possible integer overflows computing indexes in OT layout
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Nov 9, 2024
1 parent 7386be4 commit 61ee39e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hb/ot_layout_gsubgpos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,9 @@ fn apply_lookup(
match_positions[j] = (match_positions[j] as isize + delta) as _;
}

backtrack_len + match_end - ctx.buffer.idx
backtrack_len
.saturating_add(match_end)
.saturating_sub(ctx.buffer.idx)
};

for record in lookups {
Expand Down

0 comments on commit 61ee39e

Please sign in to comment.