Bug 1245959 - Check video frame has non-zero dimensions before sending image to compositor. r=nical, a=ritu
authorJamie Nicol <jnicol@mozilla.com>
Sun, 25 Sep 2016 21:34:11 +0200
changeset 358045 35790cfb2c763f26e2271faa20e6b73d75620b2f
parent 358044 26f6203bfe664100e86e8d4f54f77d23a5646121
child 358046 df2427d0d9fe8d48ff24924b5bb915cfe3d20522
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical, ritu
bugs1245959
milestone51.0a2
Bug 1245959 - Check video frame has non-zero dimensions before sending image to compositor. r=nical, a=ritu MozReview-Commit-ID: 6PlWqE6is7Z
dom/media/mediasink/VideoSink.cpp
--- a/dom/media/mediasink/VideoSink.cpp
+++ b/dom/media/mediasink/VideoSink.cpp
@@ -350,17 +350,18 @@ VideoSink::RenderVideoFrames(int32_t aMa
   AutoTArray<ImageContainer::NonOwningImage,16> images;
   TimeStamp lastFrameTime;
   MediaSink::PlaybackParams params = mAudioSink->GetPlaybackParams();
   for (uint32_t i = 0; i < frames.Length(); ++i) {
     VideoData* frame = frames[i]->As<VideoData>();
 
     frame->mSentToCompositor = true;
 
-    if (!frame->mImage || !frame->mImage->IsValid()) {
+    if (!frame->mImage || !frame->mImage->IsValid() ||
+        !frame->mImage->GetSize().width || !frame->mImage->GetSize().height) {
       continue;
     }
 
     int64_t frameTime = frame->mTime;
     if (frameTime < 0) {
       // Frame times before the start time are invalid; drop such frames
       continue;
     }