Skip to content

Commit 8940e34

Browse files
authored
fix: skip null offsets in LazyOffsetArrayIter16 instead of truncating (#212)
A NULL offset made next() return None, ending iteration and hiding every later entry. NULL is spec-legal in the GSUB/GPOS sequence-rule-set arrays, so valid fonts silently lost rule sets.
1 parent 3a193ba commit 8940e34

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/parser.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,12 +651,15 @@ impl<'a, T: FromSlice<'a>> Iterator for LazyOffsetArrayIter16<'a, T> {
651651
type Item = T;
652652

653653
fn next(&mut self) -> Option<Self::Item> {
654-
if self.index < self.array.len() {
654+
while self.index < self.array.len() {
655655
self.index += 1;
656-
self.array.get(self.index - 1)
657-
} else {
658-
None
656+
match self.array.get(self.index - 1) {
657+
None => {}
658+
s => return s,
659+
}
659660
}
661+
662+
None
660663
}
661664

662665
#[inline]

0 commit comments

Comments
 (0)