Bug 1015979 - Use a fatal assert in case of empty picture rect when creating a video frame. r=cpearce DONTBUILD
authorEric Phan <eric.phan@ensimag.grenoble-inp.fr>
Fri, 06 Jun 2014 15:11:34 +0200
changeset 206426 5086f344b647436226e88f28097a3ec97c213e64
parent 206425 e9ce0328d40d6510dc695653fa25b2cd4a89c286
child 206427 3d77c8ef5b69e951fe0c0bb69a4059353e10618d
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1015979
milestone32.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 1015979 - Use a fatal assert in case of empty picture rect when creating a video frame. r=cpearce DONTBUILD
content/media/MediaData.cpp
--- a/content/media/MediaData.cpp
+++ b/content/media/MediaData.cpp
@@ -225,17 +225,18 @@ VideoData* VideoData::Create(VideoInfo& 
   if (aBuffer.mPlanes[1].mWidth != aBuffer.mPlanes[2].mWidth ||
       aBuffer.mPlanes[1].mHeight != aBuffer.mPlanes[2].mHeight) {
     NS_ERROR("C planes with different sizes");
     return nullptr;
   }
 
   // The following situations could be triggered by invalid input
   if (aPicture.width <= 0 || aPicture.height <= 0) {
-    NS_WARNING("Empty picture rect");
+    // In debug mode, makes the error more noticeable
+    MOZ_ASSERT(false, "Empty picture rect");
     return nullptr;
   }
   if (!ValidatePlane(aBuffer.mPlanes[0]) || !ValidatePlane(aBuffer.mPlanes[1]) ||
       !ValidatePlane(aBuffer.mPlanes[2])) {
     NS_WARNING("Invalid plane size");
     return nullptr;
   }