Bug 1075640 - Check for zero length frames in GMP H264 decode. r=jesup, a=sledru
authorEthan Hugg <ethanhugg@gmail.com>
Tue, 07 Oct 2014 16:10:58 -0700
changeset 218099 45dd53a5354b
parent 218098 be43cc1b2373
child 218104 bda37eb8a921
push id539
push userryanvm@gmail.com
push date2014-10-21 20:12 +0000
treeherdermozilla-release@45dd53a5354b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, sledru
bugs1075640
milestone33.0.1
Bug 1075640 - Check for zero length frames in GMP H264 decode. r=jesup, a=sledru
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
@@ -587,16 +587,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;
   }
 
   GMPVideoEncodedFrame* frame = static_cast<GMPVideoEncodedFrame*>(ftmp);
   err = frame->CreateEmptyFrame(aInputImage._length);