Bug 101597 - Use a fatal assert in case of empty picture rect when creating a video frame. r=cpearce
☠☠ backed out by e9ce0328d40d ☠ ☠
authorEric Phan <eric.phan@ensimag.grenoble-inp.fr>
Fri, 06 Jun 2014 15:06:58 +0200
changeset 206424 cef880caa887aab5dacd94180fe9d5d567cc9fb0
parent 206423 f74d791a1904c1af513ed71d1d943333a07c6541
child 206425 e9ce0328d40d6510dc695653fa25b2cd4a89c286
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
bugs101597
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 101597 - Use a fatal assert in case of empty picture rect when creating a video frame. r=cpearce
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;
   }