Skip to content

Commit 7fd8b48

Browse files
committed
Fix lvfontio memory allocation with fixed width fonts
There was a branch of the loading that failed to set max_slots. This led to unpredicatable allocation failures. Fixes #10560
1 parent b861607 commit 7fd8b48

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

shared-module/lvfontio/OnDiskFont.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,10 @@ static bool load_font_header(lvfontio_ondiskfont_t *self, FIL *file, size_t *max
253253
*max_slots = advance_count[1] * 2 + advance_count[0];
254254
}
255255
}
256+
} else {
257+
*max_slots = advance_count[0] + advance_count[1];
256258
}
257259

258-
259260
found_glyf = true;
260261
}
261262

0 commit comments

Comments
 (0)