Skip to content

Commit

Permalink
[VP] Port segfault fix from media_libva to media_libva_next
Browse files Browse the repository at this point in the history
This applies the same fix in commit
722793d
to media_libva_interface_next.cpp

Should close #1859
  • Loading branch information
mattyoung101 committed Oct 14, 2024
1 parent ce9892c commit e76cbbb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion media_softlet/linux/common/ddi/media_libva_interface_next.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1824,7 +1824,16 @@ VAStatus MediaLibvaInterfaceNext::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_STATUS_SUCCESS;
if (tempMediaSurface->data_size >= vaimg->data_size)
{
eStatus = MOS_SecureMemcpy(tempSurfData, tempMediaSurface->data_size, imageData, vaimg->data_size);
}
else
{
eStatus = MOS_SecureMemcpy(tempSurfData, tempMediaSurface->data_size, imageData, tempMediaSurface->data_size);
}

if (eStatus != MOS_STATUS_SUCCESS)
{
DDI_ASSERTMESSAGE("Failed to copy image to surface buffer.");
Expand Down

0 comments on commit e76cbbb

Please sign in to comment.