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:
Scott Brenner
2025-05-24 21:11:31 -07:00
committed by teejusb
parent 90176a1f1c
commit 57d54a0c89
+2 -2
View File
@@ -137,8 +137,8 @@ RageSurface::RageSurface( const RageSurface &cpy )
pixels_owned = true;
if( cpy.pixels )
{
pixels = new uint8_t[ pitch*h ];
memcpy( pixels, cpy.pixels, pitch*h );
pixels = new uint8_t[ static_cast<size_t>(pitch) * h ];
memcpy( pixels, cpy.pixels, static_cast<size_t>(pitch) * h );
}
else
pixels = nullptr;