From 6c4edc97913d729df2fedf1e358c4681076acb24 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 18 Sep 2012 10:00:45 -0700 Subject: [PATCH] Bug 791167: stride*height is the size of the region. r=roc --- gfx/layers/GrallocImages.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gfx/layers/GrallocImages.cpp b/gfx/layers/GrallocImages.cpp index 904f7726d77c..92148bb41785 100644 --- a/gfx/layers/GrallocImages.cpp +++ b/gfx/layers/GrallocImages.cpp @@ -79,7 +79,7 @@ GrallocPlanarYCbCrImage::SetData(const Data& aData) // equals to the image width then we can use only one copy. if (yStride == mData.mYStride && yStride == ySize.width) { - memcpy(yChannel, mData.mYChannel, yStride * ySize.width); + memcpy(yChannel, mData.mYChannel, yStride * ySize.height); } else { for (int i = 0; i < ySize.height; i++) { memcpy(yChannel + i * yStride, @@ -89,8 +89,8 @@ GrallocPlanarYCbCrImage::SetData(const Data& aData) } if (uvStride == mData.mCbCrStride && uvStride == uvSize.width) { - memcpy(uChannel, mData.mCbChannel, uvStride * uvSize.width); - memcpy(vChannel, mData.mCrChannel, uvStride * uvSize.width); + memcpy(uChannel, mData.mCbChannel, uvStride * uvSize.height); + memcpy(vChannel, mData.mCrChannel, uvStride * uvSize.height); } else { for (int i = 0; i < uvSize.height; i++) { memcpy(uChannel + i * uvStride, -- 2.11.4.GIT