Skip to content

Commit

Permalink
[CM] Fix some CM coverity issue
Browse files Browse the repository at this point in the history
Fix out of bound access
Fix unintentional integer overflow
  • Loading branch information
XuanJessica authored and intel-mediadev committed Oct 25, 2023
1 parent f362fb5 commit 1863643
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions media_driver/agnostic/common/cm/cm_surface_3d_rt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ CM_RT_API int32_t CmSurface3DRT::WriteSurface( const unsigned char* sysMem,
return CM_INVALID_ARG_VALUE;
}

uSizeInBytes = (uint64_t)(m_width * m_height * m_depth * pixel);
uSizeInBytes = (uint64_t)m_width * m_height * m_depth * pixel;
if (sysMemSize < uSizeInBytes)
{
CM_ASSERTMESSAGE("Error: Invalid copy size.")
Expand Down Expand Up @@ -257,7 +257,7 @@ CM_RT_API int32_t CmSurface3DRT::ReadSurface( unsigned char* sysMem, CmEvent* ev
return CM_INVALID_ARG_VALUE;
}

uSizeInBytes = (uint64_t)(m_width * m_height * m_depth * pixel);
uSizeInBytes = (uint64_t)m_width * m_height * m_depth * pixel;
if (sysMemSize < uSizeInBytes)
{
CM_ASSERTMESSAGE("Error: Invalid copy size.")
Expand Down

0 comments on commit 1863643

Please sign in to comment.