diff --git a/runtime/sharings/va/va_surface.cpp b/runtime/sharings/va/va_surface.cpp index 5c72c780ca..fd30f48e31 100644 --- a/runtime/sharings/va/va_surface.cpp +++ b/runtime/sharings/va/va_surface.cpp @@ -87,6 +87,8 @@ Image *VASurface::createSharedVaSurface(Context *context, VASharingFunctions *sh imgDesc.image_width /= 2; imgDesc.image_height /= 2; imgInfo.offset = vaImage.offsets[1]; + imgInfo.yOffset = 0; + imgInfo.xOffset = 0; imgInfo.yOffsetForUVPlane = static_cast(imgInfo.offset / vaImage.pitches[0]); } sharingFunctions->destroyImage(vaImage.image_id); diff --git a/unit_tests/sharings/va/va_sharing_tests.cpp b/unit_tests/sharings/va/va_sharing_tests.cpp index 77dc017d34..fa1f686a91 100644 --- a/unit_tests/sharings/va/va_sharing_tests.cpp +++ b/unit_tests/sharings/va/va_sharing_tests.cpp @@ -168,6 +168,8 @@ TEST_F(VaSharingTests, givenMockVaWhenVaSurfaceIsCreatedWithNotAlignedWidthAndHe vaSurface->getSurfaceOffsets(surfaceOffsets); EXPECT_EQ(alignedHeight, surfaceOffsets.yOffsetForUVplane); EXPECT_EQ(alignedOffset, surfaceOffsets.offset); + EXPECT_EQ(0u, surfaceOffsets.yOffset); + EXPECT_EQ(0u, surfaceOffsets.xOffset); delete vaSurface; }