From af1ca12b6b39b2ef4c97fba0ceed45311d593a1c Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 22 Nov 2015 23:08:38 +0100 Subject: [PATCH] Fix an off-by-two that could lead to undefined samples in the buffer in panic situations. --- resampling_queue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.2