From: Fan WenJie fanwj@mail.ustc.edu.cn
Signed-off-by: Fan WenJie fanwj@mail.ustc.edu.cn --- dlls/win32u/sysparams.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 71e52b71719..e0fb536f7b0 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -4323,13 +4323,16 @@ LONG get_char_dimensions( HDC hdc, TEXTMETRICW *metric, int *height ) 'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H', 'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
- if (metric && !NtGdiGetTextMetricsW( hdc, metric, 0 )) return 0; + if (metric && !NtGdiGetTextMetricsW( hdc, metric, 0 )) goto fail;
if (!NtGdiGetTextExtentExW( hdc, abcdW, ARRAYSIZE(abcdW), 0, NULL, NULL, &sz, 0 )) - return 0; + goto fail;
if (height) *height = sz.cy; return (sz.cx / 26 + 1) / 2; +fail: + if (height) *height = 1; + return 0; }
/* get text metrics and/or "average" char width of the specified logfont