The program crashes at the end of the LoadSound function.
Before you dereference pointers, you have to initialize them. Otherwise, the behaviour is undefined. MenuSong is not initialized.
If only there were a way to make std::vector not initialize its elements... Why one have to pay for setting them to zeros if the only thing that happens with these zeros is simply overwriting them several lines later?
That's indeed a pity. Unfortunately, there are a some places in the C++ standard library that are far from optimal (for example specifications when to use swap in STL implementations).
However, that's usually not
the reason to abandon std::vector. I really doubt the speed is a concern here. And even if it were, it would be more important to write the program
correctly. Especially when one's not very experienced with manual memory management, std::vector is the far better choice, when real projects and not just experiments are in play.
And apart from all that, one can still write or search for a small buffer class, if this is a often-needed functionality.
I finally got it, thank God for pointers.
When you really want to continue using raw pointers, you should spend some time on understanding how they exactly work. But even with a good understanding, you should prefer RAII where possible. Believe me, it makes your life a lot easier.
Then you also get rid of silly constructs like this
if (m_buffer != NULL)
{
delete (m_buffer);
m_buffer = NULL;
}