View Single Post
Old 09-23-2014, 08:16 AM   #19
Human being with feelings
Xenakios's Avatar
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,711

Originally Posted by Alkamist View Post
    std::cout << myfile.tellg() << std::endl;
    delete[] mChunkID;
    delete[] mChunkSize;
    if (!strcmp(mChunkID, "RIFF")){} 
      std::cerr << "Error: not a RIFF file" << std::endl;
You have undefined behavior there. (Which does NOT mean you will get a crash for sure, undefined behavior is much worse, anything can happen...) You delete the mChunkID buffer, yet call strcmp() on it after that.

I noticed you already used std::vectors elsewhere in your code, so why are you not using those instead of the nasty new-allocated buffers here too?
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
Xenakios is offline   Reply With Quote