Avoid overflow when calculating visible_cells

(cherry picked from commit 9e28df22a0)
This commit is contained in:
Patrick Dawson 2020-07-13 01:39:39 +02:00 committed by Rémi Verschelde
parent f6479786c0
commit 8218170b3c
1 changed files with 1 additions and 1 deletions

View File

@ -228,7 +228,7 @@ struct SpatialIndexer2D {
List<VisibilityNotifier2D *> added; List<VisibilityNotifier2D *> added;
List<VisibilityNotifier2D *> removed; List<VisibilityNotifier2D *> removed;
int visible_cells = (end.x - begin.x) * (end.y - begin.y); uint64_t visible_cells = (uint64_t)(end.x - begin.x) * (uint64_t)(end.y - begin.y);
if (visible_cells > 10000) { if (visible_cells > 10000) {