chaoticgd/wrench

Stack Overflow on Windows

AlphaDelta opened this issue · 0 comments

std::size_t toc_get_level_table_offset(stream& iso, std::size_t toc_base) {
uint8_t buffer[TOC_MAX_SIZE];

The array uint8_t buffer[TOC_MAX_SIZE]; attempts to allocate an array to the stack which is greater than the default stack reserve on windows (1MiB), which ends up causing a crash when creating a new project.

Possible fixes:

  • Allocate the array on the heap
  • Increase the stack reserve of the exe to 2MiB (which is >TOC_MAX_SIZE) with editbin.exe /stack:2097152.