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

Commit 59633a1e authored by Andreas Huber's avatar Andreas Huber
Browse files

Signal an error if aac decoding fails early.

Change-Id: I8b886a7642aaf83fa008fefb38cb4f92267ca948
related-to-bug: 4272179
parent 87ae62f3
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -234,6 +234,23 @@ status_t AACDecoder::read(
            mConfig->aacPlusUpsamplingFactor, mConfig->desiredChannels);

        CHECK(mNumDecodedBuffers > 0);

        if (decoderErr != MP4AUDEC_SUCCESS) {
            // If decoding fails this early, the fields in mConfig may
            // not be valid and we cannot recover.

            LOGE("Unable to decode aac content, decoder returned error %d",
                 decoderErr);

            buffer->release();
            buffer = NULL;

            mInputBuffer->release();
            mInputBuffer = NULL;

            return ERROR_UNSUPPORTED;
        }

        if (mNumDecodedBuffers == 1) {
            mUpsamplingFactor = mConfig->aacPlusUpsamplingFactor;
            // Check on the sampling rate to see whether it is changed.