mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 04:19:12 +00:00
Fix crash on debug when painting on removed tiles after resizing the tileset
This commit is contained in:
parent
0b33d15462
commit
7bcd511315
@ -783,7 +783,11 @@ static void remove_unused_tiles_from_tileset(
|
||||
const doc::tile_index ti = doc::tile_geti(t);
|
||||
n = std::max<int>(n, ti+1);
|
||||
#ifdef _DEBUG
|
||||
++tilesHistogram2[ti];
|
||||
// This check is necessary in case the tilemap has a reference
|
||||
// to a tile outside the valid range (e.g. when we resize the
|
||||
// tileset deleting tiles that will not be present anymore)
|
||||
if (ti >= 0 && ti < tilesHistogram2.size())
|
||||
++tilesHistogram2[ti];
|
||||
#endif
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user