mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:07:35 +00:00
PaintBrush: Fix crash with flood fill. (#1881)
Fixed a crash occurring when initiating a flood fill out of the bitmap rectangle.
This commit is contained in:
parent
f38897ef20
commit
b07bd1b95c
1 changed files with 3 additions and 0 deletions
|
@ -47,6 +47,9 @@ static void flood_fill(Gfx::Bitmap& bitmap, const Gfx::Point& start_position, Co
|
|||
if (target_color == fill_color)
|
||||
return;
|
||||
|
||||
if (!bitmap.rect().contains(start_position))
|
||||
return;
|
||||
|
||||
Queue<Gfx::Point> queue;
|
||||
queue.enqueue(start_position);
|
||||
while (!queue.is_empty()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue