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

Commit 80bf6fe8 authored by Alexy Joseph's avatar Alexy Joseph Committed by Ricardo Cerqueira
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: I8f6809a896b91aaffa8f5ae17d8ae4a3920a4b73
parent 266e8cff
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -352,7 +352,14 @@ void SoftAMR::onQueueFilled(OMX_U32 portIndex) {
            }

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

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

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