mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:27:45 +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<>
|
template<>
|
||||||
inline void Bitmap::set_pixel<StorageFormat::RGB32>(int x, int y, Color color)
|
inline void Bitmap::set_pixel<StorageFormat::RGB32>(int x, int y, Color color)
|
||||||
{
|
{
|
||||||
|
ASSERT(rect().contains(x, y));
|
||||||
scanline(y)[x] = color.value();
|
scanline(y)[x] = color.value();
|
||||||
}
|
}
|
||||||
template<>
|
template<>
|
||||||
inline void Bitmap::set_pixel<StorageFormat::RGBA32>(int x, int y, Color color)
|
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
|
scanline(y)[x] = color.value(); // drop alpha
|
||||||
}
|
}
|
||||||
inline void Bitmap::set_pixel(int x, int y, Color color)
|
inline void Bitmap::set_pixel(int x, int y, Color color)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue