Codechange: address CodeQL issue "Multiplication result converted to larger type" (#10306)
Most are very unlikely to ever be triggered in our codebase; two stand out: linkgraph and money cheat. Those, potentially, could wrap earlier than expected.
This commit is contained in:
@@ -139,7 +139,7 @@ const char *VideoDriver_Dedicated::Start(const StringList &parm)
|
||||
this->UpdateAutoResolution();
|
||||
|
||||
int bpp = BlitterFactory::GetCurrentBlitter()->GetScreenDepth();
|
||||
_dedicated_video_mem = (bpp == 0) ? nullptr : MallocT<byte>(_cur_resolution.width * _cur_resolution.height * (bpp / 8));
|
||||
_dedicated_video_mem = (bpp == 0) ? nullptr : MallocT<byte>(static_cast<size_t>(_cur_resolution.width) * _cur_resolution.height * (bpp / 8));
|
||||
|
||||
_screen.width = _screen.pitch = _cur_resolution.width;
|
||||
_screen.height = _cur_resolution.height;
|
||||
|
||||
Reference in New Issue
Block a user