mirror of
git://git.yoctoproject.org/meta-intel.git
synced 2025-07-19 12:59:03 +02:00
intel-media-driver: Fixed double free issue.
Fixed double free issue running with multiple channel decoding with vaapisink plugins in gstreamer-vaapi master. Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
This commit is contained in:
parent
4a0107ac96
commit
33c5426f5c
|
@ -0,0 +1,86 @@
|
|||
From 437e63b6c35eb5d12aac18d7f76ce1a702ad16e0 Mon Sep 17 00:00:00 2001
|
||||
From: Lim Siew Hoon <siew.hoon.lim@intel.com>
|
||||
Date: Thu, 2 Dec 2021 15:50:33 +0000
|
||||
Subject: [PATCH] [Media Common] Fix the user setting memory free
|
||||
|
||||
From 4b8a411f2b8df112cbb5dbf8562735700cd15cf1 Mon Sep 17 00:00:00 2001
|
||||
From: "Wang, Pingli" <pingli.wang@intel.com>
|
||||
Date: Thu, 2 Dec 2021 17:57:50 +0800
|
||||
Subject: [PATCH] [Media Common]Fix the user setting memory free
|
||||
|
||||
This commit fix the #1300
|
||||
|
||||
Signed-off-by: Wang, Pingli <pingli.wang@intel.com>
|
||||
|
||||
This patch was imported from iHD media-driver git server
|
||||
(https://github.com/intel/media-driver.git) as of pull request
|
||||
https://github.com/intel/media-driver/pull/1305.
|
||||
|
||||
Upstream-status: Submitted
|
||||
|
||||
Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
|
||||
---
|
||||
media_softlet/linux/common/os/mos_utilities_specific_next.cpp | 4 ++++
|
||||
media_softlet/linux/common/os/mos_utilities_specific_next.h | 4 ++++
|
||||
2 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/media_softlet/linux/common/os/mos_utilities_specific_next.cpp b/media_softlet/linux/common/os/mos_utilities_specific_next.cpp
|
||||
index 584ba086..c138cb08 100644
|
||||
--- a/media_softlet/linux/common/os/mos_utilities_specific_next.cpp
|
||||
+++ b/media_softlet/linux/common/os/mos_utilities_specific_next.cpp
|
||||
@@ -70,6 +70,7 @@ double MosUtilities::MosGetTime()
|
||||
//!
|
||||
const char *const MosUtilitiesSpecificNext::m_mosTracePath = "/sys/kernel/debug/tracing/trace_marker_raw";
|
||||
int32_t MosUtilitiesSpecificNext::m_mosTraceFd = -1;
|
||||
+MosMutex MosUtilitiesSpecificNext::m_userSettingMutex;
|
||||
|
||||
std::map<std::string, std::map<std::string, std::string>> MosUtilitiesSpecificNext::m_regBuffer;
|
||||
|
||||
@@ -612,6 +613,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureSet(MOS_PUF_KEYLIST *pKeyList, M
|
||||
MOS_AtomicIncrement(&MosUtilities::m_mosMemAllocFakeCounter); //ulValueBuf does not count it, because it is freed after the MEMNJA final report.
|
||||
MOS_OS_NORMALMESSAGE("ulValueBuf %p for key %s", ulValueBuf, NewKey.pValueArray[0].pcValueName);
|
||||
|
||||
+ m_userSettingMutex.Lock();
|
||||
if ( (iPos = UserFeatureFindValue(*Key, NewKey.pValueArray[0].pcValueName)) == NOT_FOUND)
|
||||
{
|
||||
//not found, add a new value to key struct.
|
||||
@@ -620,6 +622,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureSet(MOS_PUF_KEYLIST *pKeyList, M
|
||||
if (iPos >= UF_CAPABILITY)
|
||||
{
|
||||
MOS_OS_ASSERTMESSAGE("user setting value icount %d must less than UF_CAPABILITY(64)", iPos);
|
||||
+ m_userSettingMutex.Unlock();
|
||||
return MOS_STATUS_USER_FEATURE_KEY_READ_FAILED;
|
||||
}
|
||||
|
||||
@@ -646,6 +649,7 @@ MOS_STATUS MosUtilitiesSpecificNext::UserFeatureSet(MOS_PUF_KEYLIST *pKeyList, M
|
||||
NewKey.pValueArray[0].ulValueBuf,
|
||||
NewKey.pValueArray[0].ulValueLen);
|
||||
|
||||
+ m_userSettingMutex.Unlock();
|
||||
return MOS_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
diff --git a/media_softlet/linux/common/os/mos_utilities_specific_next.h b/media_softlet/linux/common/os/mos_utilities_specific_next.h
|
||||
index 878ce4e6..57e505d0 100644
|
||||
--- a/media_softlet/linux/common/os/mos_utilities_specific_next.h
|
||||
+++ b/media_softlet/linux/common/os/mos_utilities_specific_next.h
|
||||
@@ -30,6 +30,8 @@
|
||||
#include "mos_defs.h"
|
||||
#include "mos_utilities_specific.h"
|
||||
|
||||
+class MosMutex;
|
||||
+
|
||||
class MosUtilitiesSpecificNext
|
||||
{
|
||||
public:
|
||||
@@ -294,5 +296,7 @@ public:
|
||||
static int32_t m_mosTraceFd;
|
||||
static const char* const m_mosTracePath;
|
||||
static std::map<std::string, std::map<std::string, std::string>> m_regBuffer;
|
||||
+private:
|
||||
+ static MosMutex m_userSettingMutex;
|
||||
};
|
||||
#endif // __MOS_UTILITIES_SPECIFIC_NEXT_H__
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -20,6 +20,7 @@ DEPENDS += "libva gmmlib"
|
|||
|
||||
SRC_URI = "git://github.com/intel/media-driver.git;protocol=https;nobranch=1 \
|
||||
file://0001-MOS-user-setting-reentrant.patch \
|
||||
file://0001-Media-Common-Fix-the-user-setting-memory-free.patch \
|
||||
"
|
||||
|
||||
SRCREV = "ec4dc5d653733c21f8bf390794674052b5abdb09"
|
||||
|
|
Loading…
Reference in New Issue
Block a user