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.
This commit is contained in:
Clemens Ladisch 2004-11-24 16:31:56 +00:00
parent 0ed778404d
commit 290541d0ae

View file

@ -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)