mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 11:18:13 +00:00
LibGfx: assert Bitmap::set_pixel does not write out of bounds
This commit is contained in:
parent
5567408bab
commit
23c4f1a3d4
1 changed files with 2 additions and 0 deletions
|
@ -300,11 +300,13 @@ inline Color Bitmap::get_pixel(int x, int y) const
|
|||
template<>
|
||||
inline void Bitmap::set_pixel<StorageFormat::RGB32>(int x, int y, Color color)
|
||||
{
|
||||
ASSERT(rect().contains(x, y));
|
||||
scanline(y)[x] = color.value();
|
||||
}
|
||||
template<>
|
||||
inline void Bitmap::set_pixel<StorageFormat::RGBA32>(int x, int y, Color color)
|
||||
{
|
||||
ASSERT(rect().contains(x, y));
|
||||
scanline(y)[x] = color.value(); // drop alpha
|
||||
}
|
||||
inline void Bitmap::set_pixel(int x, int y, Color color)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue