mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 12:06:07 +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
Notes:
sideshowbarker
2024-07-19 07:27:37 +09:00
Author: https://github.com/sleepy-monax
Commit: b07bd1b95c
Pull-request: https://github.com/SerenityOS/serenity/pull/1881
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