From 75e38864d9f758ae4bcea173efd3f91ec02883f1 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sun, 5 Jul 2015 09:35:04 +0000 Subject: [PATCH] possible fix for a crash for some external audio interfaces --- mac/sound.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mac/sound.cpp b/mac/sound.cpp index 595a3ed9..82818d96 100755 --- a/mac/sound.cpp +++ b/mac/sound.cpp @@ -252,12 +252,13 @@ void CSound::GetAudioDeviceInfos ( const AudioDeviceID DeviceID, char* sC_strPropValue = (char*) malloc ( CFStringGetLength ( sPropertyStringValue ) + 1 ); - CFStringGetCString ( sPropertyStringValue, - sC_strPropValue, - CFStringGetLength ( sPropertyStringValue ) + 1, - kCFStringEncodingISOLatin1 ); - - strDeviceName = sC_strPropValue; + if ( CFStringGetCString ( sPropertyStringValue, + sC_strPropValue, + CFStringGetLength ( sPropertyStringValue ) + 1, + kCFStringEncodingISOLatin1 ) ) + { + strDeviceName = sC_strPropValue; + } } // check if device is input or output or both (is that possible?)