diff options
author | Paras Nagda <pnagda@codeaurora.org> | 2014-10-17 13:15:03 +0530 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:24:25 -0600 |
commit | bb9319b7254ef2e72c7473ad186618f6690e714f (patch) | |
tree | bb2ef6dbf358665e40a1a4914a0a248e07ea199c /media/libstagefright/MPEG4Writer.cpp | |
parent | b5ccf81c19a7e9ce9b330abe734f1bae76d50796 (diff) | |
download | frameworks_av-bb9319b7254ef2e72c7473ad186618f6690e714f.zip frameworks_av-bb9319b7254ef2e72c7473ad186618f6690e714f.tar.gz frameworks_av-bb9319b7254ef2e72c7473ad186618f6690e714f.tar.bz2 |
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
Diffstat (limited to 'media/libstagefright/MPEG4Writer.cpp')
-rw-r--r-- | media/libstagefright/MPEG4Writer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index ed22ade..26686ab 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -2734,6 +2734,11 @@ void MPEG4Writer::Track::writeTrackHeader(bool use32BitOffset) { ALOGV("%s track time scale: %d", mIsAudio? "Audio": "Video", mTimeScale); + if (mMdatSizeBytes == 0) { + ALOGW("Track data is not available."); + return; + } + uint32_t now = getMpeg4Time(); mOwner->beginBox("trak"); writeTkhdBox(now); |