Codec2Buffer: vstride to match height

Make sure vstride matches height from the format to
accommodate apps with this assumption.

Bug: 198104271
Test: cts/media/device-small
Signed-off-by: Vinay Kalia <vinaykalia@google.com>
Change-Id: I27db6483e74c0981a76f9c7dcd208ef9b31ad947
(cherry picked from commit d8c4810131941a1e23f297f0c37bb12fcfbaceb8)
diff --git a/media/codec2/sfplugin/Codec2Buffer.cpp b/media/codec2/sfplugin/Codec2Buffer.cpp
index 4070478..62c8fcd 100644
--- a/media/codec2/sfplugin/Codec2Buffer.cpp
+++ b/media/codec2/sfplugin/Codec2Buffer.cpp
@@ -248,7 +248,10 @@
 
         // align width and height to support subsampling cleanly
         uint32_t stride = align(view.crop().width, 2) * divUp(layout.planes[0].allocatedDepth, 8u);
-        uint32_t vStride = align(view.crop().height, 2);
+
+        int32_t fmtHeight = mHeight;
+        format->findInt32(KEY_HEIGHT, &fmtHeight);
+        uint32_t vStride = align(fmtHeight, 2);
 
         bool tryWrapping = !copy;