Bug 1245959 - Check video frame has non-zero dimensions before sending image to compositor. r=nical
authorJamie Nicol <jnicol@mozilla.com>
Sun, 25 Sep 2016 21:34:11 +0200
changeset 315231 e1babcef001ebbfcd1852e86c15f924e3f0c2af4
parent 315230 05a02a824ae21a7496903b719be11a90e6082f2b
child 315232 c55bcb7c777ea09431b4d16903ed079ae5632648
child 315270 20cf91d1aecd370d788eff5e50c8255db4abc279
push id30744
push userihsiao@mozilla.com
push dateMon, 26 Sep 2016 10:35:40 +0000
treeherdermozilla-central@c55bcb7c777e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1245959
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1245959 - Check video frame has non-zero dimensions before sending image to compositor. r=nical 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;
     }