From 67ef46f1c24be3ab8691debc791d5fc22c0d061f Mon Sep 17 00:00:00 2001 From: "Xu, Zhengguo" Date: Tue, 30 Jul 2024 14:47:12 +0800 Subject: [PATCH] [Decode] Fix memleak in ULT --- media_driver/linux/common/ddi/media_libva.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/media_driver/linux/common/ddi/media_libva.cpp b/media_driver/linux/common/ddi/media_libva.cpp index 302fa48e89e..7f19be68aff 100755 --- a/media_driver/linux/common/ddi/media_libva.cpp +++ b/media_driver/linux/common/ddi/media_libva.cpp @@ -3963,6 +3963,11 @@ VAStatus DdiMedia_DestroyBuffer ( break; //return va_STATUS_SUCCESS; } + if (buf->lock) + { + //buf->lock->unlock(); //todo: lock ahead firstly? + MOS_Delete(buf->lock); //todo: delete lock to avoid leak? check MOS_FreeMemory(buf) in code + } MOS_FreeMemory(buf); DdiMedia_DestroyBufFromVABufferID(mediaCtx, buffer_id);