mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
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:
parent
0ed778404d
commit
290541d0ae
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue