From 174132af8d0ffcb5ebd290fffe9dad5eaf7d9e19 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 9 Mar 2023 22:18:12 -0800 Subject: [PATCH] gstallocator: Use the right allocator instance to free memory In the case GST_ALLOCATOR_FLAG_CUSTOM_ALLOC is set, `copy` is allocated by the default allocator and not mem->allocator. Part-of: --- subprojects/gstreamer/gst/gstallocator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gstreamer/gst/gstallocator.c b/subprojects/gstreamer/gst/gstallocator.c index 14a29f4390..6ce64dd4d6 100644 --- a/subprojects/gstreamer/gst/gstallocator.c +++ b/subprojects/gstreamer/gst/gstallocator.c @@ -110,7 +110,7 @@ _fallback_mem_copy (GstMemory * mem, gssize offset, gssize size) if (!gst_memory_map (copy, &dinfo, GST_MAP_WRITE)) { GST_CAT_WARNING (GST_CAT_MEMORY, "could not write map memory %p", copy); - gst_allocator_free (mem->allocator, copy); + gst_allocator_free (copy->allocator, copy); gst_memory_unmap (mem, &sinfo); return NULL; }