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

Commit 9c7d957b authored by Mingming Yin's avatar Mingming Yin Committed by Linux Build Service Account
Browse files

stagefright: Remove assert for corrupt clips for AMRNB

Corrupt AMR NB clips were crashing media player
This was due to the assert in the AMRNB decoder.
To avoid this, post error and exit if corrupt
clip is played.

CRs-Fixed: 486681

Change-Id: I4c27a95978015e5493799ca23a3598559ad8bd9d
parent 6a399a15
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -352,7 +352,14 @@ void SoftAMR::onQueueFilled(OMX_U32 /* portIndex */) {
            }
            }


            size_t frameSize = getFrameSize(mode);
            size_t frameSize = getFrameSize(mode);
            CHECK_GE(inHeader->nFilledLen, frameSize);
            if (inHeader->nFilledLen < frameSize) {
                ALOGE("Filled length vs frameSize %u vs %lu. Corrupt clip?",
                   inHeader->nFilledLen, frameSize);

                notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
                mSignalledError = true;
                return;
            }


            int16_t *outPtr = (int16_t *)outHeader->pBuffer;
            int16_t *outPtr = (int16_t *)outHeader->pBuffer;