Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 028540b3 authored by Ram Mohan M's avatar Ram Mohan M Committed by Pawin Vongmasa
Browse files

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
parent f213eca9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -126,8 +126,8 @@ struct CodecObserver : public IOmxObserver {
        android::Vector<BufferInfo>* iBuffers = nullptr,
        android::Vector<BufferInfo>* oBuffers = nullptr) {
        int64_t finishBy = android::ALooper::GetNowUs() + timeoutUs;
        android::Mutex::Autolock autoLock(msgLock);
        for (;;) {
            android::Mutex::Autolock autoLock(msgLock);
            android::List<Message>::iterator it = msgQueue.begin();
            while (it != msgQueue.end()) {
                if (it->type ==