Fix for code scanning alert: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
+2
-2
@@ -137,8 +137,8 @@ RageSurface::RageSurface( const RageSurface &cpy )
|
|||||||
pixels_owned = true;
|
pixels_owned = true;
|
||||||
if( cpy.pixels )
|
if( cpy.pixels )
|
||||||
{
|
{
|
||||||
pixels = new uint8_t[ pitch*h ];
|
pixels = new uint8_t[ static_cast<size_t>(pitch) * h ];
|
||||||
memcpy( pixels, cpy.pixels, pitch*h );
|
memcpy( pixels, cpy.pixels, static_cast<size_t>(pitch) * h );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pixels = nullptr;
|
pixels = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user