From 1bf982ff88b1c0400c1a66ed9aaa8faeba74a75c Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Tue, 22 Oct 2019 09:29:15 +0900 Subject: [PATCH] [WIN32SS][NTGDI] 'otm' is always non-NULL in epilogue --- win32ss/gdi/ntgdi/font.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/win32ss/gdi/ntgdi/font.c b/win32ss/gdi/ntgdi/font.c index ba51f26608d..db79c534ca6 100644 --- a/win32ss/gdi/ntgdi/font.c +++ b/win32ss/gdi/ntgdi/font.c @@ -928,25 +928,24 @@ NtGdiGetOutlineTextMetricsInternalW (HDC hDC, return 0; } IntGetOutlineTextMetrics(FontGDI, Size, potm); - if (otm) + + _SEH2_TRY { - _SEH2_TRY - { - ProbeForWrite(otm, Size, 1); - RtlCopyMemory(otm, potm, Size); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END + ProbeForWrite(otm, Size, 1); + RtlCopyMemory(otm, potm, Size); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END - if (!NT_SUCCESS(Status)) - { - EngSetLastError(ERROR_INVALID_PARAMETER); - Size = 0; - } + if (!NT_SUCCESS(Status)) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + Size = 0; } + ExFreePoolWithTag(potm,GDITAG_TEXT); return Size; } -- 2.17.1