From e10cdd2a86f316330569ab4c27ca0a4dd13c1f97 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sun, 5 May 2013 13:21:30 +0300 Subject: [PATCH] Gfx: Minor fix --- Common/Gfx/Util/DWriteHelpers.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Common/Gfx/Util/DWriteHelpers.cpp b/Common/Gfx/Util/DWriteHelpers.cpp index dee4247b..491f0f2a 100644 --- a/Common/Gfx/Util/DWriteHelpers.cpp +++ b/Common/Gfx/Util/DWriteHelpers.cpp @@ -159,9 +159,18 @@ HRESULT GetGDIFamilyNameFromDWriteFont(IDWriteFont* font, WCHAR* buffer, UINT bu BOOL stringsExist; HRESULT hr = font->GetInformationalStrings( DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &strings, &stringsExist); - if (SUCCEEDED(hr) && stringsExist) + if (SUCCEEDED(hr)) { - hr = strings->GetString(0, buffer, bufferSize); + if (stringsExist) + { + hr = strings->GetString(0, buffer, bufferSize); + } + else + { + hr = E_FAIL; + } + + strings->Release(); } return hr;