From 858f8791ec7f5f8b0443963fbaaec91191eb6d41 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 7 Jan 2020 22:09:59 +0100 Subject: GRAPHICS: FONTS: Fix memory override --- graphics/fonts/macfont.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'graphics') diff --git a/graphics/fonts/macfont.cpp b/graphics/fonts/macfont.cpp index 50635fda47..e8a52d10b2 100644 --- a/graphics/fonts/macfont.cpp +++ b/graphics/fonts/macfont.cpp @@ -414,7 +414,8 @@ MacFONTFont *MacFONTFont::scaleFont(const MacFONTFont *src, int newSize, bool bo } Graphics::Surface srcSurf; - srcSurf.create(src->getFontSize() * 2, src->getFontSize() * 2, PixelFormat::createFormatCLUT8()); + srcSurf.create(MAX(src->getFontSize() * 2, newSize * 2), MAX(src->getFontSize() * 2, newSize * 2), + PixelFormat::createFormatCLUT8()); int dstGraySize = newSize * 2 * newSize; int *dstGray = (int *)malloc(dstGraySize * sizeof(int)); -- cgit v1.2.3