Skip to content

Commit

Permalink
Fix bug in anchor points method (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenzV authored Jun 22, 2024
1 parent c2d3bf1 commit 41cf80c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tables/kerx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ pub struct AnchorPoints<'a>(&'a [u8]);
impl AnchorPoints<'_> {
/// Returns a mark and current anchor points at action index.
pub fn get(&self, action_index: u16) -> Option<(u16, u16)> {
let offset = usize::from(action_index) * u16::SIZE;
// Each action contains two 16-bit fields, so we must
// double the action_index to get the correct offset here.
let offset = usize::from(action_index) * u16::SIZE * 2;
let mut s = Stream::new_at(self.0, offset)?;
Some((s.read::<u16>()?, s.read::<u16>()?))
}
Expand Down

0 comments on commit 41cf80c

Please sign in to comment.