Skip to content

Commit 51d99b8

Browse files
committed
[buffer] Fix buffer size enlargement (harfruzz PR #62)
We were wrongly, comparing with self.len, not the self.info.len which is the current length of the info/pos arrays. This was resulting in inadverently shrinking the buffer sometimes, causing out-of-bounds access and crash, for example in text-rendering-tests MORX-31 test.
1 parent 445ae9e commit 51d99b8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/hb/buffer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ impl hb_buffer_t {
12401240

12411241
#[must_use]
12421242
pub fn ensure(&mut self, size: usize) -> bool {
1243-
if size < self.len {
1243+
if size <= self.info.len() {
12441244
return true;
12451245
}
12461246

0 commit comments

Comments
 (0)