summaryrefslogtreecommitdiffstats
path: root/recipes-multimedia
diff options
context:
space:
mode:
authorYew, Chang Ching <chang.ching.yew@intel.com>2022-03-02 08:30:25 +0800
committerAnuj Mittal <anuj.mittal@intel.com>2022-03-02 17:39:01 +0800
commitc95e1f7f3cff30c278aaac51015ec0ae185b5dc7 (patch)
tree20eca386b9c12f32243476248ef220227d3478ac /recipes-multimedia
parent07189850ab85423774cf2290e5c587bf7ac0b149 (diff)
downloadmeta-intel-c95e1f7f3cff30c278aaac51015ec0ae185b5dc7.tar.gz
onevpl: Fix missing mutex init in sample common
Fix regression 15010791475 Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'recipes-multimedia')
-rw-r--r--recipes-multimedia/onevpl/onevpl/0001-sample_common-Fix-regression-of-missing-mutex-init.patch48
-rw-r--r--recipes-multimedia/onevpl/onevpl_2022.0.3.bb1
2 files changed, 49 insertions, 0 deletions
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 @@
1From f6f9d62817d58909fe9eafa555b1638f165dc746 Mon Sep 17 00:00:00 2001
2From: "Yew, Chang Ching" <chang.ching.yew@intel.com>
3Date: Wed, 2 Mar 2022 07:56:57 +0800
4Subject: [PATCH] sample_common: Fix regression of missing mutex init
5
6Upstream-Status: Submitted
7innersource PR #377
8
9Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com>
10---
11 tools/legacy/sample_common/src/vm/thread_linux.cpp | 14 ++++++++++++++
12 1 file changed, 14 insertions(+)
13
14diff --git a/tools/legacy/sample_common/src/vm/thread_linux.cpp b/tools/legacy/sample_common/src/vm/thread_linux.cpp
15index 819d811f..c17ce5bf 100644
16--- a/tools/legacy/sample_common/src/vm/thread_linux.cpp
17+++ b/tools/legacy/sample_common/src/vm/thread_linux.cpp
18@@ -22,6 +22,13 @@ MSDKSemaphore::MSDKSemaphore(mfxStatus& sts, mfxU32 count) : msdkSemaphoreHandle
19 // If pthread_cond_init reports an error m_semaphore was not allocated
20 throw std::bad_alloc();
21 }
22+ res = pthread_mutex_init(&m_mutex, NULL);
23+ if (res) {
24+ if (!pthread_cond_destroy(&m_semaphore)) {
25+ // do nothing
26+ }
27+ throw std::bad_alloc();
28+ }
29 }
30
31 MSDKSemaphore::~MSDKSemaphore(void) {
32@@ -97,6 +104,13 @@ MSDKEvent::MSDKEvent(mfxStatus& sts, bool manual, bool state) : msdkEventHandle(
33 //non-zero means something is wrong, throw bad_alloc
34 throw std::bad_alloc();
35 }
36+ res = pthread_mutex_init(&m_mutex, NULL);
37+ if (res) {
38+ if (!pthread_cond_destroy(&m_event)) {
39+ // do nothing
40+ }
41+ throw std::bad_alloc();
42+ }
43 }
44
45 MSDKEvent::~MSDKEvent(void) {
46--
472.17.1
48
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 \
13 file://0001-samples-Addin-wayland-scanner-auto-generate-on-cmake.patch \ 13 file://0001-samples-Addin-wayland-scanner-auto-generate-on-cmake.patch \
14 file://0002-sample_misc-Addin-basic-wayland-dmabuf-support.patch \ 14 file://0002-sample_misc-Addin-basic-wayland-dmabuf-support.patch \
15 file://0003-sample_misc-use-wayland-dmabuf-to-render-nv12.patch \ 15 file://0003-sample_misc-use-wayland-dmabuf-to-render-nv12.patch \
16 file://0001-sample_common-Fix-regression-of-missing-mutex-init.patch \
16 " 17 "
17SRCREV = "efc259f8b7ee5c334bca1a904a503186038bbbdd" 18SRCREV = "efc259f8b7ee5c334bca1a904a503186038bbbdd"
18S = "${WORKDIR}/git" 19S = "${WORKDIR}/git"