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

Commit 07b75c84 authored by Paras Nagda's avatar Paras Nagda Committed by Gerrit - the friendly Code Review server
Browse files

MPEG4Writer: Fix MediaServer crash in MM Stress test.

  - Media Server crash is happening while accessing
    codecspecific data at the end of recording since
    stopRecording is issued from script even before
    codec spefic data is returned from encoder.
  - Size check is added to prevent accessing
    codecspecific data in this case.

 CRs-Fixed: 732893

Change-Id: I77ce3c02c76c4d3cc4345d761ad505090ef29530
parent d9b04af0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2699,6 +2699,11 @@ void MPEG4Writer::Track::writeTrackHeader(bool use32BitOffset) {
    ALOGV("%s track time scale: %d",
        mIsAudio? "Audio": "Video", mTimeScale);

    if (mMdatSizeBytes == 0) {
      ALOGV("Track data is not available.");
      return;
    }

    uint32_t now = getMpeg4Time();
    mOwner->beginBox("trak");
        writeTkhdBox(now);