Merge "gralloc: Fix NV12 and NV21 stride"
diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp
index 6af0eea..77c9922 100644
--- a/libgralloc/alloc_controller.cpp
+++ b/libgralloc/alloc_controller.cpp
@@ -566,8 +566,7 @@
case HAL_PIXEL_FORMAT_YCbCr_422_SP:
case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS:
case HAL_PIXEL_FORMAT_NV12_ENCODEABLE: //Same as YCbCr_420_SP_VENUS
- ystride = hnd->width;
- cstride = hnd->width/2;
+ ystride = cstride = hnd->width;
ycbcr->y = (void*)hnd->base;
ycbcr->cb = (void*)(hnd->base + ystride * hnd->height);
ycbcr->cr = (void*)(hnd->base + ystride * hnd->height + 1);
@@ -581,8 +580,7 @@
case HAL_PIXEL_FORMAT_YCrCb_420_SP_ADRENO:
case HAL_PIXEL_FORMAT_NV21_ZSL:
case HAL_PIXEL_FORMAT_RAW_SENSOR:
- ystride = hnd->width;
- cstride = hnd->width/2;
+ ystride = cstride = hnd->width;
ycbcr->y = (void*)hnd->base;
ycbcr->cr = (void*)(hnd->base + ystride * hnd->height);
ycbcr->cb = (void*)(hnd->base + ystride * hnd->height + 1);