BrickGame
BrickGame copied to clipboard
Random buffer overruns
I was experiencing an "Stack cookie instrumentation code detected a stack-based buffer overrun." exception on large maps and it seems the following line is responsible for this:
BrickTerrainGenerationLibrary.cpp:134 CavernProbabilitySamples[LocalZ + 4] = NextCavernProbabilitySample;
On rare occasions CavernProbabilitySamples is being addressed at index 128 there but the maximum is 127.
A simple workaround for this is to increase the array size (Line 123) by +1.
Please consider changing this if there will be a future update. Took me a couple of hours to figure this out.
Thank you for the report. I can't try this out right now, but from reading the code, it does look like simply increasing the size of the array by 1 is the correct fix.