Commit 28ba62cb authored by David Reid's avatar David Reid

Add some validation to the resampler.

parent aa983db0
...@@ -49681,6 +49681,14 @@ MA_API ma_result ma_linear_resampler_set_rate_ratio(ma_linear_resampler* pResamp ...@@ -49681,6 +49681,14 @@ MA_API ma_result ma_linear_resampler_set_rate_ratio(ma_linear_resampler* pResamp
ma_uint32 n; ma_uint32 n;
ma_uint32 d; ma_uint32 d;
if (pResampler == NULL) {
return MA_INVALID_ARGS;
}
if (ratioInOut <= 0) {
return MA_INVALID_ARGS;
}
d = 1000; d = 1000;
n = (ma_uint32)(ratioInOut * d); n = (ma_uint32)(ratioInOut * d);
...@@ -50110,6 +50118,10 @@ MA_API ma_result ma_resampler_set_rate_ratio(ma_resampler* pResampler, float rat ...@@ -50110,6 +50118,10 @@ MA_API ma_result ma_resampler_set_rate_ratio(ma_resampler* pResampler, float rat
return MA_INVALID_ARGS; return MA_INVALID_ARGS;
} }
if (ratio <= 0) {
return MA_INVALID_ARGS;
}
d = 1000; d = 1000;
n = (ma_uint32)(ratio * d); n = (ma_uint32)(ratio * d);
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