summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-12-12 17:30:03 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-12-12 17:30:03 +0100
commit757c7d348d648c4cd1568baf64e5ba654346a065 (patch)
tree6c30cc973551258b632eb1033e0cbb2e7a826097
parentbc5d67c61345758741fe087c6b5282402b0b2465 (diff)
parent2507ee5ca4c453fa3f2f70f39a8681cafb25c448 (diff)
Merge pull request #69956 from oOjor-elOo/patch-1
Windows: Validate that the font family name exists before trying to get the font family
-rw-r--r--platform/windows/os_windows.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 34afc4ea14..a083a98c72 100644
--- a/platform/windows/os_windows.cpp
+++ b/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();
}