diff options
author | Eugene Sandulenko | 2020-01-07 22:09:59 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2020-01-07 22:09:59 +0100 |
commit | 858f8791ec7f5f8b0443963fbaaec91191eb6d41 (patch) | |
tree | 6fb7cb29201f59a0dcb5a195d90ced15312a7074 | |
parent | a98d3832d9d08eae63f48008466f7ecbdfca16bf (diff) | |
download | scummvm-rg350-858f8791ec7f5f8b0443963fbaaec91191eb6d41.tar.gz scummvm-rg350-858f8791ec7f5f8b0443963fbaaec91191eb6d41.tar.bz2 scummvm-rg350-858f8791ec7f5f8b0443963fbaaec91191eb6d41.zip |
GRAPHICS: FONTS: Fix memory override
-rw-r--r-- | graphics/fonts/macfont.cpp | 3 |
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)); |