From e9dcae6c35185d58f41d49b8952f9d55984532fd Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Fri, 22 Jun 2018 21:11:38 -0700 Subject: Fix code for handling switch between sync styles at runtime --- render_sdl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'render_sdl.c') diff --git a/render_sdl.c b/render_sdl.c index cb870e1..d743de2 100755 --- a/render_sdl.c +++ b/render_sdl.c @@ -1124,7 +1124,7 @@ static void update_source(audio_source *src, double rc, uint8_t sync_changed) src->lowpass_alpha = lowpass_alpha; if (sync_changed) { uint32_t alloc_size = sync_to_audio ? src->num_channels * buffer_samples : nearest_pow2(min_buffered * 4 * src->num_channels); - src->back = realloc(src->back, alloc_size); + src->back = realloc(src->back, alloc_size * sizeof(int16_t)); if (sync_to_audio) { src->front = malloc(alloc_size * sizeof(int16_t)); } else { -- cgit v1.2.3