Skip to content

Commit

Permalink
[VP] Fix gstreamer ximagesrc segfault
Browse files Browse the repository at this point in the history
make the memcpy size smaller than surface size.
  • Loading branch information
pengwan1 authored and intel-mediadev committed Sep 3, 2024
1 parent 347eff0 commit 722793d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion media_driver/linux/common/ddi/media_libva.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5615,7 +5615,15 @@ VAStatus DdiMedia_PutImage(
}

//Copy data from image to temp surferce
MOS_STATUS eStatus = MOS_SecureMemcpy(tempSurfData, tempMediaSurface->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 722793d

Please sign in to comment.