Bug 1344591 - Ensure BlankVideoCreate doesn't round down Cb and Cr strides. r=gerald
authorChris Pearce <cpearce@mozilla.com>
Mon, 06 Mar 2017 13:52:45 +1300
changeset 374992 5368b2790c4292a3004bd2c9b44ecd3dd6187e0d
parent 374991 197b5eb5e400671ef75994718d6bb77c0b7d874b
child 374993 41bd2eefc82322918a7f5d299dd913fc20c65316
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1344591
milestone54.0a1
Bug 1344591 - Ensure BlankVideoCreate doesn't round down Cb and Cr strides. r=gerald MozReview-Commit-ID: Jjvzo7WfrFE
dom/media/platforms/agnostic/BlankDecoderModule.cpp
--- a/dom/media/platforms/agnostic/BlankDecoderModule.cpp
+++ b/dom/media/platforms/agnostic/BlankDecoderModule.cpp
@@ -141,27 +141,27 @@ public:
     buffer.mPlanes[0].mStride = mFrameWidth;
     buffer.mPlanes[0].mHeight = mFrameHeight;
     buffer.mPlanes[0].mWidth = mFrameWidth;
     buffer.mPlanes[0].mOffset = 0;
     buffer.mPlanes[0].mSkip = 0;
 
     // Cb plane.
     buffer.mPlanes[1].mData = frame.get() + sizeY;
-    buffer.mPlanes[1].mStride = mFrameWidth / 2;
-    buffer.mPlanes[1].mHeight = mFrameHeight / 2;
-    buffer.mPlanes[1].mWidth = mFrameWidth / 2;
+    buffer.mPlanes[1].mStride = (mFrameWidth + 1) / 2;
+    buffer.mPlanes[1].mHeight = (mFrameHeight + 1) / 2;
+    buffer.mPlanes[1].mWidth = (mFrameWidth + 1) / 2;
     buffer.mPlanes[1].mOffset = 0;
     buffer.mPlanes[1].mSkip = 0;
 
     // Cr plane.
     buffer.mPlanes[2].mData = frame.get() + sizeY;
-    buffer.mPlanes[2].mStride = mFrameWidth / 2;
-    buffer.mPlanes[2].mHeight = mFrameHeight / 2;
-    buffer.mPlanes[2].mWidth = mFrameWidth / 2;
+    buffer.mPlanes[2].mStride = (mFrameWidth + 1) / 2;
+    buffer.mPlanes[2].mHeight = (mFrameHeight + 1) / 2;
+    buffer.mPlanes[2].mWidth = (mFrameWidth + 1) / 2;
     buffer.mPlanes[2].mOffset = 0;
     buffer.mPlanes[2].mSkip = 0;
 
     // Set to color white.
     memset(buffer.mPlanes[0].mData, 255, sizeY);
     memset(buffer.mPlanes[1].mData, 128, sizeCbCr);
 
     return VideoData::CreateAndCopyData(mInfo,