File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -2185,7 +2185,7 @@ int setup_wasapi_stream_one_side(cubeb_stream * stm,
2185
2185
2186
2186
void wasapi_find_matching_output_device (cubeb_stream * stm) {
2187
2187
HRESULT hr;
2188
- cubeb_device_info * input_device;
2188
+ cubeb_device_info * input_device = nullptr ;
2189
2189
cubeb_device_collection collection;
2190
2190
2191
2191
// Only try to match to an output device if the input device is a bluetooth
@@ -2220,11 +2220,13 @@ void wasapi_find_matching_output_device(cubeb_stream * stm) {
2220
2220
2221
2221
for (uint32_t i = 0 ; i < collection.count ; i++) {
2222
2222
cubeb_device_info dev = collection.device [i];
2223
- if (dev.type == CUBEB_DEVICE_TYPE_OUTPUT &&
2224
- dev. group_id && !strcmp (dev.group_id , input_device->group_id ) &&
2223
+ if (dev.type == CUBEB_DEVICE_TYPE_OUTPUT && dev. group_id && input_device &&
2224
+ !strcmp (dev.group_id , input_device->group_id ) &&
2225
2225
dev.default_rate == input_device->default_rate ) {
2226
- LOG (" Found matching device for %s: %s" , input_device->friendly_name , dev.friendly_name );
2227
- stm->output_device_id = utf8_to_wstr (reinterpret_cast <char const *>(dev.devid ));
2226
+ LOG (" Found matching device for %s: %s" , input_device->friendly_name ,
2227
+ dev.friendly_name );
2228
+ stm->output_device_id =
2229
+ utf8_to_wstr (reinterpret_cast <char const *>(dev.devid ));
2228
2230
}
2229
2231
}
2230
2232
You can’t perform that action at this time.
0 commit comments