[PATCH 0/1] MR9905: dwrite: Zero 'current' in create_font_collection().
From: Paul Gofman <pgofman@codeweavers.com> --- dlls/dwrite/font.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index c1aae46738a..f207bade10e 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -4673,7 +4673,7 @@ HRESULT create_font_collection(IDWriteFactory7 *factory, IDWriteFontFileEnumerat struct list scannedfiles; IDWriteFontSetBuilder1 *builder; IDWriteFontSet *fontset = NULL; - BOOL current; + BOOL current = FALSE; HRESULT hr; *ret = NULL; @@ -4690,6 +4690,8 @@ HRESULT create_font_collection(IDWriteFactory7 *factory, IDWriteFontFileEnumerat IDWriteFontFile *file; BOOL same = FALSE; + current = FALSE; + hr = IDWriteFontFileEnumerator_GetCurrentFontFile(enumerator, &file); if (FAILED(hr)) break; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9905
That fixes Warhammer Vermintide 2 launcher which stopped working after a change introduced in 604e43d34a003084b67c2fd32f5df815c940a812 . .Net WPF implementation of IDWriteFontFileEnumerator only sets the lower two bytes of the returned BOOL value. So if originally 'current' has something in higher bytes the enumeration won't stop properly and then error out in IDWriteFontFileEnumerator_GetCurrentFontFile, failing the creating of font collection altogether. Wine-Mono and / or .Net code seems to do something weird here, but probably it won't hurt to restore the more robust behaviour in dwrite which was previously there. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9905#note_127094
This merge request was approved by Nikolay Sivov. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9905
participants (3)
-
Nikolay Sivov (@nsivov) -
Paul Gofman -
Paul Gofman (@gofman)