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

Commit 73d59b21 authored by George Burgess IV's avatar George Burgess IV Committed by Gerrit Code Review
Browse files

Merge "mp4: fix potential dereferences of NULL"

parents 11d6c4cf b6776488
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -4505,6 +4505,9 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio(


    if (objectTypeIndication == 0x6B || objectTypeIndication == 0x69) {
    if (objectTypeIndication == 0x6B || objectTypeIndication == 0x69) {
        // mp3 audio
        // mp3 audio
        if (mLastTrack == NULL)
            return ERROR_MALFORMED;

        AMediaFormat_setString(mLastTrack->meta,AMEDIAFORMAT_KEY_MIME, MEDIA_MIMETYPE_AUDIO_MPEG);
        AMediaFormat_setString(mLastTrack->meta,AMEDIAFORMAT_KEY_MIME, MEDIA_MIMETYPE_AUDIO_MPEG);
        return OK;
        return OK;
    }
    }
@@ -4595,6 +4598,10 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio(
        if (offset >= csd_size || csd[offset] != 0x01) {
        if (offset >= csd_size || csd[offset] != 0x01) {
            return ERROR_MALFORMED;
            return ERROR_MALFORMED;
        }
        }

        if (mLastTrack == NULL) {
            return ERROR_MALFORMED;
        }
        // formerly kKeyVorbisInfo
        // formerly kKeyVorbisInfo
        AMediaFormat_setBuffer(mLastTrack->meta,
        AMediaFormat_setBuffer(mLastTrack->meta,
                AMEDIAFORMAT_KEY_CSD_0, &csd[offset], len1);
                AMEDIAFORMAT_KEY_CSD_0, &csd[offset], len1);