diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-04 18:11:39 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-04 18:11:39 +0100 |
commit | 4f0ab7a386a80af9b22a1ce5eba037d6c591ce57 (patch) | |
tree | bfce91c26c943d0611212c4ea14a0d080360b969 | |
parent | f0d679a7c5f450d704ea5b19a12280863ad2f8a2 (diff) |
src/dijkstra: fix use after free on quickload
-rw-r--r-- | src/dijkstra.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dijkstra.cpp b/src/dijkstra.cpp index c9433132..4bdb3ab7 100644 --- a/src/dijkstra.cpp +++ b/src/dijkstra.cpp @@ -401,7 +401,10 @@ void cache::allocate(point from, uint32_t max_dist) array = Array<chunk_cache>{ValueInit, len}; else for (auto i = 0uz; i < len; i++) + { + array[i].chunk = {}; array[i].exists = {}; + } } size_t cache::get_chunk_index(Vector2i start, Vector2ui size, Vector2i coord) |