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

Commit 72497b7c authored by Marco Nelissen's avatar Marco Nelissen Committed by Android Git Automerger
Browse files

am 8c02c891: Merge "SoftAVCDec: Exit gracefully when memory allocation fails in the decoder"

* commit '8c02c891':
  SoftAVCDec: Exit gracefully when memory allocation fails in the decoder
parents 195ffcb8 8c02c891
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -477,6 +477,9 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) {

    if (NULL == mCodecCtx) {
        if (OK != initDecoder()) {
            ALOGE("Failed to initialize decoder");
            notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
            mSignalledError = true;
            return;
        }
    }
@@ -593,6 +596,14 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) {
                return;
            }

            bool allocationFailed = (IVD_MEM_ALLOC_FAILED == (s_dec_op.u4_error_code & 0xFF));
            if (allocationFailed) {
                ALOGE("Allocation failure in decoder");
                notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
                mSignalledError = true;
                return;
            }

            bool resChanged = (IVD_RES_CHANGED == (s_dec_op.u4_error_code & 0xFF));

            GETTIME(&mTimeEnd, NULL);