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

Commit 9bc021a3 authored by akirilov's avatar akirilov Committed by Atanas Kirilov
Browse files

MediaExtractor: stop rendering when an error occurs

Bug: 68664359
Bug: 110435401

Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.StagefrightTest#testStagefright_bug_68664359
Test: cts-tradefed run cts -m CtsSecurityTestCases -t android.security.cts.StagefrightTest#testStagefright_bug_110435401

Change-Id: Icff96fcaa76a5871e7f175b0384d47d5dca7313f
Merged-In: If1322524fcfebc6c5f139288f044b0189da66c1b
parent cc5d25bb
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -246,8 +246,9 @@ MediaBuffer* MidiEngine::readBuffer() {
        EAS_I32 numRendered;
        EAS_RESULT result = EAS_Render(mEasData, p, mEasConfig->mixBufferSize, &numRendered);
        if (result != EAS_SUCCESS) {
            ALOGE("EAS_Render returned %ld", result);
            break;
            ALOGE("EAS_Render() returned %ld, numBytesOutput = %d", result, numBytesOutput);
            buffer->release();
            return NULL; // Stop processing to prevent infinite loops.
        }
        p += numRendered * mEasConfig->numChannels;
        numBytesOutput += numRendered * mEasConfig->numChannels * sizeof(EAS_PCM);