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

Commit 6d8ed959 authored by James Dong's avatar James Dong
Browse files

If MP3 decoder output frame size were 0, media server would crash.

This is to log an error message should that happen.

Change-Id: I0f947cd7a8e6639b4f11a928bf90286a34cc652e
parent 34fba669
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@
 * limitations under the License.
 */

//#define LOG_NDEBUG 0
#define LOG_TAG "MP3Decoder"

#include "MP3Decoder.h"

#include "include/pvmp3decoder_api.h"
@@ -175,7 +178,12 @@ status_t MP3Decoder::read(
            != NO_DECODING_ERROR) {
        LOGV("mp3 decoder returned error %d", decoderErr);

        if (decoderErr != NO_ENOUGH_MAIN_DATA_ERROR) {
        if (decoderErr != NO_ENOUGH_MAIN_DATA_ERROR ||
                mConfig->outputFrameSize == 0) {

            if (mConfig->outputFrameSize == 0) {
                LOGE("Output frame size is 0");
            }
            buffer->release();
            buffer = NULL;