mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 07:47:07 +00:00
winegstreamer: Avoid releasing wg_allocator memory samples twice.
When the sample size is too small, we were releasing it from the memory, but kept the next_sample pointer set. Later, when the transform removes the sample from the allocator, its refcount was decremented one more time, effectively leaking the sample.
This commit is contained in:
parent
762dda3837
commit
1b5ddc1e2f
|
@ -196,9 +196,9 @@ static GstMemory *wg_allocator_alloc(GstAllocator *gst_allocator, gsize size,
|
|||
pthread_mutex_lock(&allocator->mutex);
|
||||
|
||||
memory->sample = allocator->next_sample;
|
||||
if (memory->sample && memory->sample->max_size >= size)
|
||||
allocator->next_sample = NULL;
|
||||
else
|
||||
allocator->next_sample = NULL;
|
||||
|
||||
if (memory->sample && memory->sample->max_size < size)
|
||||
release_memory_sample(allocator, memory, true);
|
||||
|
||||
list_add_tail(&allocator->memory_list, &memory->entry);
|
||||
|
|
Loading…
Reference in a new issue