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 225743 452bc7db811efca729be637e0bd53a350a6ab20c
parent 225742 bb26f48546308c431892de26e0bdbf51024c882c
child 225744 eb43a2c05eb323754258d1c0afc77b785f2b5401
push id3998
push userrjesup@wgate.com
push dateMon, 20 Oct 2014 04:04:07 +0000
treeherdermozilla-beta@452bc7db811e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, lmandel
bugs1075640
milestone34.0
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
@@ -625,16 +625,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);