Bug 1075640 - Check for zero length frames in GMP H264 decode r=jesup a=lmandel
authorEthan Hugg <ethanhugg@gmail.com>
Tue, 07 Oct 2014 16:10:58 -0700
changeset 233375 d0081f5a668f5377c5a4b253205aba72dd2a6f8f
parent 233374 e0616172775d96acb185f42e1d61fc637617bb65
child 233376 97dc0ff141448b864d4b8ac8263c2db0b02fb5b6
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, lmandel
bugs1075640
milestone35.0a2
Bug 1075640 - Check for zero length frames in GMP H264 decode r=jesup a=lmandel
media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
--- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
@@ -620,16 +620,20 @@ WebrtcGmpVideoDecoder::Decode_g(const we
                                 int64_t aRenderTimeMs)
 {
   MOZ_ASSERT(mHost);
   if (!mGMP) {
     // destroyed via Terminate()
     return WEBRTC_VIDEO_CODEC_ERROR;
   }
 
+  if (!aInputImage._length) {
+    return WEBRTC_VIDEO_CODEC_ERROR;
+  }
+
   GMPVideoFrame* ftmp = nullptr;
   GMPErr err = mHost->CreateFrame(kGMPEncodedVideoFrame, &ftmp);
   if (err != GMPNoErr) {
     return WEBRTC_VIDEO_CODEC_ERROR;
   }
 
   UniquePtr<GMPVideoEncodedFrame> frame(static_cast<GMPVideoEncodedFrame*>(ftmp));
   err = frame->CreateEmptyFrame(aInputImage._length);