Module: wine Branch: master Commit: 53f6d82e69377a3f4f112275bbc61978946ad2a5 URL: https://gitlab.winehq.org/wine/wine/-/commit/53f6d82e69377a3f4f112275bbc6197...
Author: Jiajin Cui cuijiajin@uniontech.com Date: Fri Aug 19 08:49:52 2022 +0800
win32u: Don't allow a replaced font to be a replacement.
This is to prevent replacement loops.
---
dlls/win32u/font.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index e26c7bfa316..e281db9b0c8 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -903,6 +903,12 @@ static BOOL add_family_replacement( const WCHAR *new_name, const WCHAR *replace return FALSE; }
+ if (family->replacement) + { + TRACE( "%s is replaced by another font, skipping.\n", debugstr_w(replace) ); + return FALSE; + } + if (!(new_family = create_family( new_name, NULL ))) return FALSE; new_family->replacement = family; family->refcount++;