diff --git a/src/os/macosx/font_osx.cpp b/src/os/macosx/font_osx.cpp index 2bd290f4e6..8d7987119a 100644 --- a/src/os/macosx/font_osx.cpp +++ b/src/os/macosx/font_osx.cpp @@ -242,8 +242,8 @@ const Sprite *CoreTextFontCache::InternalGetGlyph(GlyphID key, bool use_aa) /* We only need the alpha channel, as we apply our own colour constants to the sprite. */ int pitch = Align(bb_width, 16); - uint8_t *bmp = CallocT(bb_height * pitch); - CFAutoRelease context(CGBitmapContextCreate(bmp, bb_width, bb_height, 8, pitch, nullptr, kCGImageAlphaOnly)); + CFAutoRelease context(CGBitmapContextCreate(nullptr, bb_width, bb_height, 8, pitch, nullptr, kCGImageAlphaOnly)); + const uint8_t *bmp = static_cast(CGBitmapContextGetData(context.get())); /* Set antialias according to requirements. */ CGContextSetAllowsAntialiasing(context.get(), use_aa); CGContextSetAllowsFontSubpixelPositioning(context.get(), use_aa);