mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 00:34:03 +02:00
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
This commit is contained in:
+8
-2
@@ -65046,8 +65046,14 @@ MA_API ma_result ma_noise_set_type(ma_noise* pNoise, ma_noise_type type)
|
|||||||
return MA_INVALID_ARGS;
|
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)
|
static MA_INLINE float ma_noise_f32_white(ma_noise* pNoise)
|
||||||
|
|||||||
Reference in New Issue
Block a user