From 290541d0ae5b9119b9e3aab20bf56753c23c5c22 Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Wed, 24 Nov 2004 16:31:56 +0000 Subject: [PATCH] fix miscalculation of buffer size in snd_output_buffer_need() snd_output_buffer_need() did not account for the already used part of the buffer when trying to allocating new space. --- src/output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output.c b/src/output.c index 071113bd..93530cd9 100644 --- a/src/output.c +++ b/src/output.c @@ -258,7 +258,7 @@ static int snd_output_buffer_need(snd_output_t *output, size_t size) alloc = 256; else alloc = buffer->alloc; - while (alloc < size) + while (alloc < buffer->size + size) alloc *= 2; buf = realloc(buffer->buf, alloc); if (!buf) -- 2.47.1