From 0b35d623c2140fa7fbab46cf04c0ad73120004f8 Mon Sep 17 00:00:00 2001 From: Frederik Slos Date: Sat, 28 Jun 2014 17:26:58 +0200 Subject: [PATCH] fix: lower base sample for interpolated sample could be out-of-bounds --- player.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/player.c b/player.c index bc569c338..2fe334ccc 100644 --- a/player.c +++ b/player.c @@ -400,7 +400,7 @@ static int stuff_buffer(double playback_rate, short *inptr, short *outptr) { if (rand() < p_stuff * RAND_MAX) { stuff = playback_rate > 1.0 ? -1 : 1; - stuffsamp = rand() % (frame_size - 1); + stuffsamp = 1 + (rand() % (frame_size - 2)); } pthread_mutex_lock(&vol_mutex);