Bug 1075640 - Check for zero length frames in GMP H264 decode r=jesup
authorEthan Hugg <ethanhugg@gmail.com>
Tue, 07 Oct 2014 16:10:58 -0700
changeset 210628 adde0b51f5b2c517b8b1d685b959b8d2b3817279
parent 210627 8a1aa0399dcaf73a5a29f3aea184dd2cf6178e28
child 210629 5d7d3ac7582ff7b53de709e0c16c357f0ed393f2
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjesup
bugs1075640
milestone36.0a1
Bug 1075640 - Check for zero length frames in GMP H264 decode r=jesup
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);