From: Steinar H. Gunderson Date: Sun, 22 Nov 2015 22:08:38 +0000 (+0100) Subject: Fix an off-by-two that could lead to undefined samples in the buffer in panic situations. X-Git-Tag: 1.0.0~90 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=af1ca12b6b39b2ef4c97fba0ceed45311d593a1c Fix an off-by-two that could lead to undefined samples in the buffer in panic situations. --- diff --git a/resampling_queue.cpp b/resampling_queue.cpp index 80d1229..13f4bdf 100644 --- a/resampling_queue.cpp +++ b/resampling_queue.cpp @@ -118,7 +118,7 @@ bool ResamplingQueue::get_output_samples(double pts, float *samples, ssize_t num // or we're dropping a lot of data. fprintf(stderr, "PANIC: Out of input samples to resample, still need %d output samples!\n", int(vresampler.out_count)); - memset(vresampler.out_data, 0, vresampler.out_count * sizeof(float)); + memset(vresampler.out_data, 0, vresampler.out_count * 2 * sizeof(float)); return false; }