As far as I know, this isn\'t caused by an infinite recursion.
The program functioned correctly with smaller arrays (it is an audio editor). Now I have increased fun
As Vlad pointed out, don't allocate 50MB on the stack.
But, the point is moot because you don't need to allocate any data. Try replacing your entire code fragment with a single call to std::reverse:
std::reverse(&sound_data[0], &sound_data[track_samples]);
#include