mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-06 23:20:03 +01:00
Fix issue CVE-2018-17096: Replace assert with runtime exception
This commit is contained in:
parent
46531e5b92
commit
a1c400eb2c
@ -186,8 +186,10 @@ BPMDetect::BPMDetect(int numChannels, int aSampleRate) :
|
|||||||
|
|
||||||
// choose decimation factor so that result is approx. 1000 Hz
|
// choose decimation factor so that result is approx. 1000 Hz
|
||||||
decimateBy = sampleRate / TARGET_SRATE;
|
decimateBy = sampleRate / TARGET_SRATE;
|
||||||
assert(decimateBy > 0);
|
if ((decimateBy <= 0) || (decimateBy * DECIMATED_BLOCK_SIZE < INPUT_BLOCK_SIZE))
|
||||||
assert(INPUT_BLOCK_SIZE < decimateBy * DECIMATED_BLOCK_SIZE);
|
{
|
||||||
|
ST_THROW_RT_ERROR("Too small samplerate");
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate window length & starting item according to desired min & max bpms
|
// Calculate window length & starting item according to desired min & max bpms
|
||||||
windowLen = (60 * sampleRate) / (decimateBy * MIN_BPM);
|
windowLen = (60 * sampleRate) / (decimateBy * MIN_BPM);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user