diff --git a/libs/zita-resampler/vmresampler.cc b/libs/zita-resampler/vmresampler.cc index 9193d09cd6..87a68d371b 100644 --- a/libs/zita-resampler/vmresampler.cc +++ b/libs/zita-resampler/vmresampler.cc @@ -169,7 +169,13 @@ VMResampler::process (void) double ph, dp; float a, *p1, *p2; - if (!_table) return 1; + if (!_table) { + n = std::min (inp_count, out_count); + memcpy (out_data, inp_data, n * sizeof (float)); + out_count -= n; + inp_count -= n; + return 1; + } const int hl = _table->_hl; const unsigned int np = _table->_np; @@ -208,6 +214,7 @@ VMResampler::process (void) out_count -= to_proc; in += to_proc; if (in >= _inmax) { + // assert (_inmax == in) memcpy (_buff, _buff + in, (2 * hl - 1) * sizeof (float)); in = 0; }