From c95e1f7f3cff30c278aaac51015ec0ae185b5dc7 Mon Sep 17 00:00:00 2001 From: "Yew, Chang Ching" Date: Wed, 2 Mar 2022 08:30:25 +0800 Subject: onevpl: Fix missing mutex init in sample common Fix regression 15010791475 Signed-off-by: Yew, Chang Ching Signed-off-by: Anuj Mittal --- ...mmon-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 (limited to 'recipes-multimedia') 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" +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 +--- + 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" -- cgit v1.2.3-54-g00ecf