check for NULL data->interface passed to KsPropertySetEnumerateCallback. Thanks to Asinbow Wang

This commit is contained in:
rbencina 2012-11-10 02:55:20 +00:00
commit 58d75e6d8e

View file

@ -581,6 +581,14 @@ static BOOL CALLBACK KsPropertySetEnumerateCallback( PDSPROPERTY_DIRECTSOUNDDEVI
int i;
DSDeviceNamesAndGUIDs *deviceNamesAndGUIDs = (DSDeviceNamesAndGUIDs*)context;
/*
Apparently data->Interface can be NULL in some cases.
Possibly virtual devices without hardware.
So we check for NULLs now. See mailing list message November 10, 2012:
"[Portaudio] portaudio initialization crash in KsPropertySetEnumerateCallback(pa_win_ds.c)"
*/
if( data->Interface )
{
if( data->DataFlow == DIRECTSOUNDDEVICE_DATAFLOW_RENDER )
{
for( i=0; i < deviceNamesAndGUIDs->outputNamesAndGUIDs.count; ++i )
@ -607,6 +615,7 @@ static BOOL CALLBACK KsPropertySetEnumerateCallback( PDSPROPERTY_DIRECTSOUNDDEVI
}
}
}
}
return TRUE;
}