mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:58:11 +00:00
LibGfx: Use Checked::multiplication_would_overflow()
This commit is contained in:
parent
63b8c6913c
commit
acf2061837
1 changed files with 1 additions and 4 deletions
|
@ -43,10 +43,7 @@ static bool size_would_overflow(BitmapFormat format, const Size& size)
|
|||
{
|
||||
if (size.width() < 0 || size.height() < 0)
|
||||
return true;
|
||||
Checked<size_t> size_in_bytes = static_cast<size_t>(size.width());
|
||||
size_in_bytes *= size.height();
|
||||
size_in_bytes *= Bitmap::bpp_for_format(format);
|
||||
return size_in_bytes.has_overflow();
|
||||
return Checked<size_t>::multiplication_would_overflow(size.width(), size.height(), Bitmap::bpp_for_format(format));
|
||||
}
|
||||
|
||||
RefPtr<Bitmap> Bitmap::create(BitmapFormat format, const Size& size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue