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

Commit f3d07843 authored by George Burgess IV's avatar George Burgess IV Committed by Automerger Merge Worker
Browse files

Merge "mp4: fix potential dereferences of NULL" am: 73d59b21

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1554526

Change-Id: Ib367e7093981e541a5be4940599df86410d3d27e
parents dd5a2f0f 73d59b21
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4505,6 +4505,9 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio(

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

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

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