check for NULL data->interface passed to KsPropertySetEnumerateCallback. Thanks to Asinbow Wang
This commit is contained in:
parent
7236740522
commit
58d75e6d8e
1 changed files with 23 additions and 14 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue