From 3c2aa5d2e9cf4e76a1a19cc3b8b8d3fad6de9d81 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Fri, 12 Feb 2021 17:23:45 -0600 Subject: [PATCH] Fix out-of-bounds array access in bucket fill --- src/ui/mappixmapitem.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ui/mappixmapitem.cpp b/src/ui/mappixmapitem.cpp index 0e02545d..a5bae08f 100644 --- a/src/ui/mappixmapitem.cpp +++ b/src/ui/mappixmapitem.cpp @@ -488,13 +488,12 @@ void MapPixmapItem::floodFill( QPoint point = todo.takeAt(0); int x = point.x(); int y = point.y(); - visited[x + y * map->getWidth()] = true; - Block *block = map->getBlock(x, y); if (!block) { continue; } + visited[x + y * map->getWidth()] = true; int xDiff = x - initialX; int yDiff = y - initialY; int i = xDiff % selectionDimensions.x();