瀏覽代碼

Merge pull request #69956 from oOjor-elOo/patch-1

Windows: Validate that the font family name exists before trying to get the font family
Rémi Verschelde 2 年之前
父節點
當前提交
757c7d348d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      platform/windows/os_windows.cpp

+ 1 - 1
platform/windows/os_windows.cpp

@@ -1059,7 +1059,7 @@ String OS_Windows::get_system_font_path(const String &p_font_name, int p_weight,
 	UINT32 index = 0;
 	BOOL exists = false;
 	HRESULT hr = font_collection->FindFamilyName((const WCHAR *)font_name.utf16().get_data(), &index, &exists);
-	if (FAILED(hr)) {
+	if (FAILED(hr) || !exists) {
 		return String();
 	}