diff --git a/media_driver/linux/common/ddi/media_libva.cpp b/media_driver/linux/common/ddi/media_libva.cpp index 7131f053992..e5df7bea54c 100755 --- a/media_driver/linux/common/ddi/media_libva.cpp +++ b/media_driver/linux/common/ddi/media_libva.cpp @@ -4696,13 +4696,7 @@ VAStatus DdiMedia_CreateImage( vaimg->offsets[1] = offsetU; if (height % 2 == 1) { - uint32_t upperSize = pitch * MOS_ALIGN_CEIL(height, 2) / 2; - uint32_t lowerSize = pitch * height / 2; - uint32_t remainSize = size - offsetU; - if (remainSize >= lowerSize && remainSize < upperSize) - { - vaimg->data_size = offsetU + pitch * MOS_ALIGN_CEIL(height, 2) / 2; - } + vaimg->data_size += pitch; } break; case VA_FOURCC_YV12: @@ -5621,7 +5615,7 @@ VAStatus DdiMedia_PutImage( } //Copy data from image to temp surferce - MOS_STATUS eStatus = MOS_SecureMemcpy(tempSurfData, vaimg->data_size, imageData, vaimg->data_size); + MOS_STATUS eStatus = MOS_SecureMemcpy(tempSurfData, tempMediaSurface->data_size, imageData, vaimg->data_size); if (eStatus != MOS_STATUS_SUCCESS) { DDI_ASSERTMESSAGE("Failed to copy image to surface buffer.");