Skip to content

Commit 1e0b3c2

Browse files
committed
path size error handling
1 parent 2914015 commit 1e0b3c2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

external/ParseInputFile.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ void parseInputFile(std::string filename, std::vector<Actor> &actors,
8787
int id = p["id"].GetInt();
8888
auto jsonCheckpoints = p["checkpoints"].GetArray();
8989
std::array<std::array<vecType, 4>, PATHALLOCATIONSIZE> checkpoints;
90+
if (jsonCheckpoints.Size() > PATHALLOCATIONSIZE) {
91+
throw JSONException(
92+
"Path Size exceeds amount allocated in memory\nEither reduce "
93+
"path size or increase PATHALLOCATIONSIZE in 'Path.hpp'");
94+
}
9095
for (int i = 0; i < jsonCheckpoints.Size(); i++) {
9196
std::array<vecType, 4> region;
9297
for (int j = 0; j < 4; j++) {

0 commit comments

Comments
 (0)