Fix a crash when passing in a NULL engine config.

This commit is contained in:
David Reid
2021-05-16 16:05:08 +10:00
parent 46a033b43a
commit 2558bbbea4
+2 -2
View File
@@ -10877,9 +10877,9 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng
/* Gain smoothing for spatialized sounds. */
pEngine->gainSmoothTimeInFrames = pConfig->gainSmoothTimeInFrames;
pEngine->gainSmoothTimeInFrames = engineConfig.gainSmoothTimeInFrames;
if (pEngine->gainSmoothTimeInFrames == 0) {
ma_uint32 gainSmoothTimeInMilliseconds = pConfig->gainSmoothTimeInMilliseconds;
ma_uint32 gainSmoothTimeInMilliseconds = engineConfig.gainSmoothTimeInMilliseconds;
if (gainSmoothTimeInMilliseconds == 0) {
gainSmoothTimeInMilliseconds = 8;
}