From cd1692ac56780e3e29892179c43f78c3434472ec Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 22 Dec 2021 17:09:11 +1000 Subject: [PATCH] Fix a crash in ma_engine_init(). This happens when the pEngine parameter is NULL. --- miniaudio.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index 04246340..5b0cbfc9 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -1,6 +1,6 @@ /* Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file. -miniaudio - v0.11.0 - 2021-12-18 +miniaudio - v0.11.1 - TBD David Reid - mackron@gmail.com @@ -70044,10 +70044,12 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng ma_spatializer_listener_config listenerConfig; ma_uint32 iListener; - if (pEngine != NULL) { - MA_ZERO_OBJECT(pEngine); + if (pEngine == NULL) { + return MA_INVALID_ARGS; } + MA_ZERO_OBJECT(pEngine); + /* The config is allowed to be NULL in which case we use defaults for everything. */ if (pConfig != NULL) { engineConfig = *pConfig; @@ -88904,6 +88906,9 @@ issues with certain devices and configurations. These can be individually enable /* REVISION HISTORY ================ +v0.11.1 - TBD + - Fix a crash when passing in NULL for the pEngine parameter of ma_engine_init(). + v0.11.0 - 2021-12-18 - Add a node graph system for advanced mixing and effect processing. - Add a resource manager for loading and streaming sounds.