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

Commit 62d719f0 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Fix out of bounds access

Bug: 109891727
Test: poc, manual w/ CTS files
Change-Id: I9056f993d1f2cf18f9f70fa60c41799e7c3585e0
parent c70268aa
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -118,9 +118,14 @@ void SoftMPEG4::onQueueFilled(OMX_U32 /* portIndex */) {
                outHeader->nFlags = OMX_BUFFERFLAG_EOS;

                List<BufferInfo *>::iterator it = outQueue.begin();
                while ((*it)->mHeader != outHeader) {
                while (it != outQueue.end() && (*it)->mHeader != outHeader) {
                    ++it;
                }
                if (it == outQueue.end()) {
                    ALOGE("couldn't find port buffer %d in outQueue: b/109891727", mNumSamplesOutput & 1);
                    android_errorWriteLog(0x534e4554, "109891727");
                    return;
                }

                BufferInfo *outInfo = *it;
                outInfo->mOwnedByUs = false;