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
commit b07bd1b95c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: sideshowbarker 2024-07-19 07:27:37 +09:00

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