Bug 1430942: Tighten up handling codec specific config. r=gerald
authorDan Glastonbury <dan.glastonbury@gmail.com>
Fri, 02 Mar 2018 01:33:53 +0200
changeset 406220 df08d5fbb370b56dd7451496d655bb260ac1c396
parent 406219 45ae173a1348b3f3d318070f84b1d7d8da89e5b4
child 406221 cf64879466c495a47732d9736ef5daa9b35cefc4
push id33546
push useraciure@mozilla.com
push dateFri, 02 Mar 2018 10:16:37 +0000
treeherdermozilla-central@b2a9a4bb5c94 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1430942
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1430942: Tighten up handling codec specific config. r=gerald MozReview-Commit-ID: 8GO6z7U1kx8
dom/media/platforms/omx/OmxDataDecoder.cpp
--- a/dom/media/platforms/omx/OmxDataDecoder.cpp
+++ b/dom/media/platforms/omx/OmxDataDecoder.cpp
@@ -615,16 +615,19 @@ OmxDataDecoder::FillCodecConfigDataToOmx
   } else if (mTrackInfo->IsVideo()) {
     csc = mTrackInfo->GetAsVideoInfo()->mExtraData;
   }
 
   MOZ_RELEASE_ASSERT(csc);
 
   // Some codecs like h264, its codec specific data is at the first packet, not in container.
   if (csc->Length()) {
+    // Buffer size should large enough for raw data.
+    MOZ_RELEASE_ASSERT(inbuf->mBuffer->nAllocLen >= csc->Length());
+
     memcpy(inbuf->mBuffer->pBuffer,
            csc->Elements(),
            csc->Length());
     inbuf->mBuffer->nFilledLen = csc->Length();
     inbuf->mBuffer->nOffset = 0;
     inbuf->mBuffer->nFlags = (OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_CODECCONFIG);
 
     LOG("Feed codec configure data to OMX component");