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 350462 18e2fbf5bd1a1bde5a198682b0e1cbff7ac96843
parent 350461 78197218635d47b1cdaf5444a4fad0897b18236c
child 350463 be6df2105dcc1f79b502469c542ff6721298cb25
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical, ritu
bugs1245959
milestone50.0
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
@@ -340,17 +340,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;
     }