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

Commit 3aac07ff authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I88f247a2,I7e1daf93 into qt-dev

* changes:
  MPEG4Extractor: Fix opus CSD size
  OpusHeader: Fix OOB write in WriteOpusHeaders()
parents 3be0ffbd ca67e38e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1772,7 +1772,7 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
                int64_t codecDelay = pre_skip * 1000000000ll / kOpusSampleRate;

                AMediaFormat_setBuffer(mLastTrack->meta,
                            AMEDIAFORMAT_KEY_CSD_0, opusInfo, sizeof(opusInfo));
                            AMEDIAFORMAT_KEY_CSD_0, opusInfo, opusInfoSize);
                AMediaFormat_setBuffer(mLastTrack->meta,
                        AMEDIAFORMAT_KEY_CSD_1, &codecDelay, sizeof(codecDelay));
                AMediaFormat_setBuffer(mLastTrack->meta,
+1 −1
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ int WriteOpusHeaders(const OpusHeader &header, int inputSampleRate,
    headerLen += AOPUS_LENGTH_SIZE;

    int headerSize = WriteOpusHeader(header, inputSampleRate, output + headerLen,
        outputSize);
        outputSize - headerLen);
    if (headerSize < 0) {
        ALOGD("%s: WriteOpusHeader failed", __func__);
        return -1;