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

Commit 2c103d6f authored by Shalaj Jain's avatar Shalaj Jain Committed by Linux Build Service Account
Browse files

stagefright: Stability fix to avoid race condition

Add bufferlock in updateBuffer to avoid race condition between
info->mFormat being assigned to mOutputFormat while mOutputFormat
is being updated at the same time

Change-Id: Ibc5a9a79a840d1c15a99be7c74ded1588edf3918
parent 38dde5fe
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2412,6 +2412,7 @@ size_t MediaCodec::updateBuffers(

    uint32_t bufferID;
    CHECK(msg->findInt32("buffer-id", (int32_t*)&bufferID));
    Mutex::Autolock al(mBufferLock);

    Vector<BufferInfo> *buffers = &mPortBuffers[portIndex];