Fix out-of-bounds array access in bucket fill

This commit is contained in:
Marcus Huderle 2021-02-12 17:23:45 -06:00
parent 36a6212af6
commit 3c2aa5d2e9

View file

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