Commit b7159b76 authored by David Reid's avatar David Reid

Update ma_noise_set_type() to prevent a crash.

Updating the noise type should not be supported. An oversight on my
part. Users should reinitialize a fresh `ma_noise` object instead.

This change simply returns an error and triggers an assert in debug
mode.

Public issue: https://github.com/mackron/miniaudio/issues/585
parent bd1c156e
......@@ -65046,8 +65046,14 @@ MA_API ma_result ma_noise_set_type(ma_noise* pNoise, ma_noise_type type)
return MA_INVALID_ARGS;
}
pNoise->config.type = type;
return MA_SUCCESS;
/*
This function should never have been implemented in the first place. Changing the type dynamically is not
supported. Instead you need to uninitialize and reinitiailize a fresh `ma_noise` object. This function
will be removed in version 0.12.
*/
MA_ASSERT(MA_FALSE);
return MA_INVALID_OPERATION;
}
static MA_INLINE float ma_noise_f32_white(ma_noise* pNoise)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment