Commit ac3e2de2 authored by Max Kellermann's avatar Max Kellermann

pcm_buffer: set size after allocation

When I implemented the pcm_buffer library, I forgot to set the new buffer size. This caused a new allocation in each pcm_buffer_get(), fortunately no memory was leaked.
parent d8db46ed
......@@ -65,7 +65,8 @@ pcm_buffer_get(struct pcm_buffer *buffer, size_t size)
g_free(buffer->buffer);
/* allocate a new buffer; align at 64kB boundaries */
buffer->buffer = g_malloc((size | 0xffff) + 1);
buffer->size = (size | 0xffff) + 1;
buffer->buffer = g_malloc(buffer->size);
}
return buffer->buffer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment