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 452bc7db811e
parent 225742 bb26f4854630
child 225744 eb43a2c05eb3
push id3998
push userrjesup@wgate.com
push date2014-10-20 04:04 +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);