diff options
author | Robin Gareus <robin@gareus.org> | 2020-02-12 17:04:44 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-02-12 17:28:53 +0100 |
commit | cc4aeb1f40c763bb449df3ff3b8fb897f46bc4aa (patch) | |
tree | 08b7062b16ae7434ea6b70441b46f0e04f66d341 /libs/ardour/disk_reader.cc | |
parent | 79f0ad0533e8a8fd0cc93331db4748c15eda24ea (diff) |
Prevent out-of-bounds array access
Diffstat (limited to 'libs/ardour/disk_reader.cc')
-rw-r--r-- | libs/ardour/disk_reader.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/ardour/disk_reader.cc b/libs/ardour/disk_reader.cc index 99fefd7959..bc49afb932 100644 --- a/libs/ardour/disk_reader.cc +++ b/libs/ardour/disk_reader.cc @@ -1513,13 +1513,13 @@ DiskReader::Declicker::alloc (samplecnt_t sr, bool fadein) if (fadein) { gain_t g = 0.0; - for (n = 0; (n < sr) && ((1.0 - g) > GAIN_COEFF_DELTA); ++n) { + for (n = 0; (n < loop_fade_length) && ((1.f - g) > GAIN_COEFF_DELTA); ++n) { vec[n] = g; g += a * (1.0 - g); } } else { gain_t g = 1.0; - for (n = 0; (n < sr) && (g > GAIN_COEFF_DELTA); ++n) { + for (n = 0; (n < loop_fade_length) && (g > GAIN_COEFF_DELTA); ++n) { vec[n] = g; g += a * -g; } |