Closed Rangi42 closed 2 years ago
In tilemap-format.cpp:
-bytes.reserve(n * 2 + NDS_HEADER_SIZE); +bytes.reserve(std::max(n * 2 + NDS_HEADER_SIZE, (size_t)NDS_HEADER_SIZE));
This will ensure it has at least NDS_HEADER_SIZE bytes despite overflow, so the subsequent insert will work.
NDS_HEADER_SIZE
insert
In tilemap-format.cpp:
This will ensure it has at least
NDS_HEADER_SIZE
bytes despite overflow, so the subsequentinsert
will work.