fix(font/freetype): mark glyph bitmap as owned if modifying
This caused a malloc fault due to a double free when deiniting the face if we didn't do this, which makes sense- making it possible to actually load bitmap fonts revealed this bug which was sitting dormant the whole time before that ever since I refactored the freetype rasterization.pull/8512/head
parent
5c1d87fda6
commit
aeae54072c
|
|
@ -594,6 +594,12 @@ pub const Face = struct {
|
|||
freetype.c.FT_PIXEL_MODE_GRAY,
|
||||
=> {},
|
||||
else => {
|
||||
// Make sure the slot owns its bitmap,
|
||||
// since we'll be modifying it here.
|
||||
if (freetype.c.FT_GlyphSlot_Own_Bitmap(glyph) != 0) {
|
||||
return error.BitmapHandlingError;
|
||||
}
|
||||
|
||||
var converted: freetype.c.FT_Bitmap = undefined;
|
||||
freetype.c.FT_Bitmap_Init(&converted);
|
||||
if (freetype.c.FT_Bitmap_Convert(
|
||||
|
|
|
|||
Loading…
Reference in New Issue