diff options
author | Tristan Matthews <tmatth@videolan.org> | 2016-05-10 21:57:11 +0300 |
---|---|---|
committer | Tristan Matthews <tmatth@videolan.org> | 2016-05-10 21:57:11 +0300 |
commit | 4dba09347256131f12c80b443250abae4bbbe042 (patch) | |
tree | 9c5f77aaf98559f928dcac0eb7a3b6313af3df81 | |
parent | 335a9a16b8a90fee92002a7256b90bb6d8498622 (diff) |
resampler: assert is sufficient for internal sanity check
-rw-r--r-- | libspeexdsp/resample.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libspeexdsp/resample.c b/libspeexdsp/resample.c index 106647e..26c0840 100644 --- a/libspeexdsp/resample.c +++ b/libspeexdsp/resample.c @@ -591,14 +591,14 @@ static int resampler_basic_zero(SpeexResamplerState *st, spx_uint32_t channel_in static int _muldiv(spx_uint32_t *result, spx_uint32_t value, spx_uint32_t mul, spx_uint32_t div) { + speex_assert(result); spx_uint32_t major = value / div; spx_uint32_t remainder = value % div; /* TODO: Could use 64 bits operation to check for overflow. But only guaranteed in C99+ */ if (remainder > UINT32_MAX / mul || major > UINT32_MAX / mul || major * mul > UINT32_MAX - remainder * mul / div) return RESAMPLER_ERR_OVERFLOW; - if (result) - *result = remainder * mul / div + major * mul; + *result = remainder * mul / div + major * mul; return RESAMPLER_ERR_SUCCESS; } |