From dbf784472eec56a6a9e6bba0d3c5a0b90d4a6749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 14 Sep 2024 18:05:40 +0200 Subject: [PATCH] [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)