https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dbf784472eec56a6a9e6b…
commit dbf784472eec56a6a9e6bba0d3c5a0b90d4a6749
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sat Sep 14 18:05:40 2024 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Thu Jan 23 23:20:54 2025 +0100
[WIN32SS:NTGDI] FontFamilyFillInfo(): Check returned IntGetOutlineTextMetrics()
size...
... before allocating pool memory, as it is done everywhere else in the code.
---
win32ss/gdi/ntgdi/freetype.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c
index 04cfc27634c..c7be5721939 100644
--- a/win32ss/gdi/ntgdi/freetype.c
+++ b/win32ss/gdi/ntgdi/freetype.c
@@ -3472,11 +3472,11 @@ FontFamilyFillInfo(PFONTFAMILYINFO Info, LPCWSTR FaceName,
RtlZeroMemory(Info, sizeof(FONTFAMILYINFO));
ASSERT_FREETYPE_LOCK_HELD();
Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL, TRUE);
+ if (!Size)
+ return;
Otm = ExAllocatePoolWithTag(PagedPool, Size, GDITAG_TEXT);
if (!Otm)
- {
return;
- }
ASSERT_FREETYPE_LOCK_HELD();
Size = IntGetOutlineTextMetrics(FontGDI, Size, Otm, TRUE);
if (!Size)