Merge "C2SoftAomEnc: Fix encoding issues with 10bit av1 clips" into udc-dev
diff --git a/media/codec2/components/aom/C2SoftAomEnc.cpp b/media/codec2/components/aom/C2SoftAomEnc.cpp
index 9102a97..d147fb4 100644
--- a/media/codec2/components/aom/C2SoftAomEnc.cpp
+++ b/media/codec2/components/aom/C2SoftAomEnc.cpp
@@ -774,10 +774,12 @@
                     if (mConversionBuffer.size() >= stride * vstride * 3) {
                         uint16_t *dstY, *dstU, *dstV;
                         dstY = (uint16_t*)mConversionBuffer.data();
-                        dstU = ((uint16_t*)mConversionBuffer.data()) + stride * vstride;
-                        dstV = ((uint16_t*)mConversionBuffer.data()) + (stride * vstride) / 4;
+                        dstU = dstY + stride * vstride;
+                        dstV = dstU + (stride * vstride) / 4;
                         convertP010ToYUV420Planar16(dstY, dstU, dstV, (uint16_t*)(rView->data()[0]),
-                                                    (uint16_t*)(rView->data()[1]), stride, stride,
+                                                    (uint16_t*)(rView->data()[1]),
+                                                    layout.planes[layout.PLANE_Y].rowInc / 2,
+                                                    layout.planes[layout.PLANE_U].rowInc / 2,
                                                     stride, stride / 2, stride / 2, stride,
                                                     vstride);
                         aom_img_wrap(&raw_frame, AOM_IMG_FMT_I42016, stride, vstride, mStrideAlign,