Fix regression 15010791475

Signed-off-by: Yew, Chang Ching <[email protected]>
---
 ...Fix-regression-of-missing-mutex-init.patch | 48 +++++++++++++++++++
 recipes-multimedia/onevpl/onevpl_2022.0.3.bb  |  1 +
 2 files changed, 49 insertions(+)
 create mode 100644 
recipes-multimedia/onevpl/onevpl/0001-sample_common-Fix-regression-of-missing-mutex-init.patch

diff --git 
a/recipes-multimedia/onevpl/onevpl/0001-sample_common-Fix-regression-of-missing-mutex-init.patch
 
b/recipes-multimedia/onevpl/onevpl/0001-sample_common-Fix-regression-of-missing-mutex-init.patch
new file mode 100644
index 00000000..eaf49405
--- /dev/null
+++ 
b/recipes-multimedia/onevpl/onevpl/0001-sample_common-Fix-regression-of-missing-mutex-init.patch
@@ -0,0 +1,48 @@
+From f6f9d62817d58909fe9eafa555b1638f165dc746 Mon Sep 17 00:00:00 2001
+From: "Yew, Chang Ching" <[email protected]>
+Date: Wed, 2 Mar 2022 07:56:57 +0800
+Subject: [PATCH] sample_common: Fix regression of missing mutex init
+
+Upstream-Status: Submitted
+innersource PR #377
+
+Signed-off-by: Yew, Chang Ching <[email protected]>
+---
+ tools/legacy/sample_common/src/vm/thread_linux.cpp | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/tools/legacy/sample_common/src/vm/thread_linux.cpp 
b/tools/legacy/sample_common/src/vm/thread_linux.cpp
+index 819d811f..c17ce5bf 100644
+--- a/tools/legacy/sample_common/src/vm/thread_linux.cpp
++++ b/tools/legacy/sample_common/src/vm/thread_linux.cpp
+@@ -22,6 +22,13 @@ MSDKSemaphore::MSDKSemaphore(mfxStatus& sts, mfxU32 count) 
: msdkSemaphoreHandle
+         // If pthread_cond_init reports an error m_semaphore was not allocated
+         throw std::bad_alloc();
+     }
++    res = pthread_mutex_init(&m_mutex, NULL);
++    if (res) {
++        if (!pthread_cond_destroy(&m_semaphore)) {
++            // do nothing
++        }
++        throw std::bad_alloc();
++    }
+ }
+ 
+ MSDKSemaphore::~MSDKSemaphore(void) {
+@@ -97,6 +104,13 @@ MSDKEvent::MSDKEvent(mfxStatus& sts, bool manual, bool 
state) : msdkEventHandle(
+         //non-zero means something is wrong, throw bad_alloc
+         throw std::bad_alloc();
+     }
++    res = pthread_mutex_init(&m_mutex, NULL);
++    if (res) {
++        if (!pthread_cond_destroy(&m_event)) {
++            // do nothing
++        }
++        throw std::bad_alloc();
++    }
+ }
+ 
+ MSDKEvent::~MSDKEvent(void) {
+-- 
+2.17.1
+
diff --git a/recipes-multimedia/onevpl/onevpl_2022.0.3.bb 
b/recipes-multimedia/onevpl/onevpl_2022.0.3.bb
index 1de48ee6..acec493d 100644
--- a/recipes-multimedia/onevpl/onevpl_2022.0.3.bb
+++ b/recipes-multimedia/onevpl/onevpl_2022.0.3.bb
@@ -13,6 +13,7 @@ SRC_URI = 
"git://github.com/oneapi-src/oneVPL.git;protocol=https;branch=master \
             
file://0001-samples-Addin-wayland-scanner-auto-generate-on-cmake.patch \
             file://0002-sample_misc-Addin-basic-wayland-dmabuf-support.patch \
             file://0003-sample_misc-use-wayland-dmabuf-to-render-nv12.patch \
+            
file://0001-sample_common-Fix-regression-of-missing-mutex-init.patch \
             "
 SRCREV = "efc259f8b7ee5c334bca1a904a503186038bbbdd"
 S = "${WORKDIR}/git"
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7442): 
https://lists.yoctoproject.org/g/meta-intel/message/7442
Mute This Topic: https://lists.yoctoproject.org/mt/89492147/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to