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

Commit afce2158 authored by Andreas Huber's avatar Andreas Huber
Browse files

The mp3 decoder should not assert that decoding was successful but return an error instead.

parent 3b06c9f3
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -160,7 +160,12 @@ status_t MP3Decoder::read(
    mConfig->outputFrameSize = buffer->size() / sizeof(int16_t);
    mConfig->pOutputBuffer = static_cast<int16_t *>(buffer->data());

    CHECK_EQ(pvmp3_framedecoder(mConfig, mDecoderBuf), NO_DECODING_ERROR);
    if (pvmp3_framedecoder(mConfig, mDecoderBuf) != NO_DECODING_ERROR) {
        mInputBuffer->release();
        mInputBuffer = NULL;

        return UNKNOWN_ERROR;
    }

    buffer->set_range(
            0, mConfig->outputFrameSize * sizeof(int16_t));