]> git.sesse.net Git - nageru/commitdiff
Fix an off-by-two that could lead to undefined samples in the buffer in panic situations.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 22 Nov 2015 22:08:38 +0000 (23:08 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 22 Nov 2015 22:08:38 +0000 (23:08 +0100)
resampling_queue.cpp

index 80d12297ce4e90c74d183eae747de34ccdb98fa6..13f4bdf445469f3071db93e83605d0d7c8ee89d0 100644 (file)
@@ -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;
                }