1
Fork 0
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:
Nicolas Van Bossuyt 2020-04-19 19:29:07 +02:00 committed by GitHub
parent f38897ef20
commit b07bd1b95c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()) {