From 028540b3a16421a5dcf5a0277820464423e0d675 Mon Sep 17 00:00:00 2001 From: Ram Mohan M Date: Tue, 26 Sep 2017 15:36:16 +0530 Subject: [PATCH] omxvts: misplaced lock can cause race condition upon unsuccessful return during timed wait, relock the mutex before accessing message list. Bug: 63796949 Change-Id: I84a43e148a6415e629cb39a6b9dfe27259f8f2fd --- media/omx/1.0/vts/functional/common/media_hidl_test_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/omx/1.0/vts/functional/common/media_hidl_test_common.h b/media/omx/1.0/vts/functional/common/media_hidl_test_common.h index e23d781baa..de043b2c66 100644 --- a/media/omx/1.0/vts/functional/common/media_hidl_test_common.h +++ b/media/omx/1.0/vts/functional/common/media_hidl_test_common.h @@ -126,8 +126,8 @@ struct CodecObserver : public IOmxObserver { android::Vector* iBuffers = nullptr, android::Vector* oBuffers = nullptr) { int64_t finishBy = android::ALooper::GetNowUs() + timeoutUs; - android::Mutex::Autolock autoLock(msgLock); for (;;) { + android::Mutex::Autolock autoLock(msgLock); android::List::iterator it = msgQueue.begin(); while (it != msgQueue.end()) { if (it->type ==