From bc1eff83cba6c7bcedc87780923771731adba47c Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 17 Apr 2017 16:23:11 +0300 Subject: [PATCH] Fix crash in audio device property change handler. PSStringFromPropertyKey should be checked before being used. --- Telegram/SourceFiles/platform/win/audio_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/platform/win/audio_win.cpp b/Telegram/SourceFiles/platform/win/audio_win.cpp index c69265b62..b83671502 100644 --- a/Telegram/SourceFiles/platform/win/audio_win.cpp +++ b/Telegram/SourceFiles/platform/win/audio_win.cpp @@ -77,7 +77,7 @@ STDMETHODIMP DeviceListener::OnPropertyValueChanged(LPCWSTR device_id, const PRO constexpr auto kKeyBufferSize = 1024; WCHAR keyBuffer[kKeyBufferSize] = { 0 }; - auto hr = Dlls::PSStringFromPropertyKey(key, keyBuffer, kKeyBufferSize); + auto hr = Dlls::PSStringFromPropertyKey ? Dlls::PSStringFromPropertyKey(key, keyBuffer, kKeyBufferSize) : E_FAIL; auto keyName = Dlls::PSStringFromPropertyKey ? (SUCCEEDED(hr) ? '"' + QString::fromWCharArray(keyBuffer) + '"' : QString("unknown")) : QString("unsupported"); // BAD GUID { 0xD4EF3098, 0xC967, 0x4A4E, { 0xB2, 0x19, 0xAC, 0xB6, 0xDA, 0x1D, 0xC3, 0x73 } };