Null check input and output stream param before dereferencing

This commit is contained in:
Paul Adenot 2020-11-03 16:36:58 +01:00
Родитель 48e349ef99
Коммит 4e851e9960
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -996,8 +996,8 @@ aaudio_stream_init(cubeb * ctx, cubeb_stream ** stream,
stm->user_ptr = user_ptr;
stm->data_callback = data_callback;
stm->state_callback = state_callback;
stm->voice_input = !!(input_stream_params->prefs & CUBEB_STREAM_PREF_VOICE);
stm->voice_output = !!(output_stream_params->prefs & CUBEB_STREAM_PREF_VOICE);
stm->voice_input = input_stream_params && !!(input_stream_params->prefs & CUBEB_STREAM_PREF_VOICE);
stm->voice_output = output_stream_params && !!(output_stream_params->prefs & CUBEB_STREAM_PREF_VOICE);
LOG("cubeb stream prefs: voice_input: %s voice_output: %s",
stm->voice_input ? "true" : "false",