mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-04 16:52:40 +08:00
[allocator]: fix dma_heap allocator
segment fault happened in mpp_allocator_put. #00 pc 00102e14 /vendor/lib/libmpp.so (mpp_allocator_put+272) #01 pc 0004705c /vendor/lib/libmpp.so (MppBufferService::~MppBufferService()+536) Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com> Change-Id: Ia4f9a3b4823bf6a5d8f3fdfd85055630222c0b43
This commit is contained in:
@@ -49,7 +49,8 @@ MPP_RET os_allocator_get(os_allocator *api, MppBufferType type)
|
||||
allocator_std;
|
||||
} break;
|
||||
case MPP_BUFFER_TYPE_DMA_HEAP: {
|
||||
*api = allocator_dma_heap;
|
||||
*api = (mpp_rt_allcator_is_valid(MPP_BUFFER_TYPE_DMA_HEAP)) ? allocator_dma_heap :
|
||||
allocator_std;
|
||||
} break;
|
||||
default : {
|
||||
ret = MPP_NOK;
|
||||
|
@@ -56,7 +56,8 @@ MPP_RET os_allocator_get(os_allocator *api, MppBufferType type)
|
||||
allocator_std;
|
||||
} break;
|
||||
case MPP_BUFFER_TYPE_DMA_HEAP: {
|
||||
*api = allocator_dma_heap;
|
||||
*api = (mpp_rt_allcator_is_valid(MPP_BUFFER_TYPE_DMA_HEAP)) ? allocator_dma_heap :
|
||||
allocator_std;
|
||||
} break;
|
||||
default : {
|
||||
ret = MPP_NOK;
|
||||
|
@@ -176,7 +176,11 @@ MPP_RET mpp_allocator_put(MppAllocator *allocator)
|
||||
}
|
||||
|
||||
MppAllocatorImpl *p = (MppAllocatorImpl *)*allocator;
|
||||
|
||||
if (!p)
|
||||
return MPP_OK;
|
||||
*allocator = NULL;
|
||||
|
||||
if (p->os_api.close && p->ctx)
|
||||
p->os_api.close(p->ctx);
|
||||
pthread_mutex_destroy(&p->lock);
|
||||
|
Reference in New Issue
Block a user