[Scummvm-git-logs] scummvm master -> 858f8791ec7f5f8b0443963fbaaec91191eb6d41

sev- sev at scummvm.org
Tue Jan 7 21:10:27 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
858f8791ec GRAPHICS: FONTS: Fix memory override


Commit: 858f8791ec7f5f8b0443963fbaaec91191eb6d41
    https://github.com/scummvm/scummvm/commit/858f8791ec7f5f8b0443963fbaaec91191eb6d41
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-01-07T22:09:59+01:00

Commit Message:
GRAPHICS: FONTS: Fix memory override

Changed paths:
    graphics/fonts/macfont.cpp


diff --git a/graphics/fonts/macfont.cpp b/graphics/fonts/macfont.cpp
index 50635fd..e8a52d1 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));
 




More information about the Scummvm-git-logs mailing list