aboutsummaryrefslogtreecommitdiff
path: root/graphics/fonts
diff options
context:
space:
mode:
authorEugene Sandulenko2020-01-07 22:09:59 +0100
committerEugene Sandulenko2020-01-07 22:09:59 +0100
commit858f8791ec7f5f8b0443963fbaaec91191eb6d41 (patch)
tree6fb7cb29201f59a0dcb5a195d90ced15312a7074 /graphics/fonts
parenta98d3832d9d08eae63f48008466f7ecbdfca16bf (diff)
downloadscummvm-rg350-858f8791ec7f5f8b0443963fbaaec91191eb6d41.tar.gz
scummvm-rg350-858f8791ec7f5f8b0443963fbaaec91191eb6d41.tar.bz2
scummvm-rg350-858f8791ec7f5f8b0443963fbaaec91191eb6d41.zip
GRAPHICS: FONTS: Fix memory override
Diffstat (limited to 'graphics/fonts')
-rw-r--r--graphics/fonts/macfont.cpp3
1 files changed, 2 insertions, 1 deletions
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));