Lot's of SamplerSounds crash the plugin


I have a drum sampler VST-plugin underway, and it has over 900 soundfiles of different hit samples. The samples are embedded into the project as Binary data. The plugin seems to work with say, under ~60 samples but when it goes over that amount, it starts to crash very frequently and gives this error:

Unhandled exception at 0x0FCDF9AC (DrumSampler.vst3) in Plugin Host.exe: 0xC0000005: Access violation writing location 0xDCFFAEEA.

Visual Studio debug says “no symbols are loaded for any call stack frame. The source code cannot be displayed”. And only gives “Show dissassembly” that seem to be a block of memory…

Same happens with VST and VST3. Samples are not more than 700Mb in overall size, so they should fit in the memory well enough.

Is there restrictions to SamplerSounds amounts or sizes or something?

0xC0000005 means you’re trying to access a nullptr



I asked a friend(Who’s pretty much adpet in C++) and He said that DLL should usually not include lots of binary data files, since this might happen because of the nature of DLL. So, If you’re trying to use huge packets of samples or anything larger “data” like images, please don’t use binaries inside DLL. It might work for you if you have big empty HDD, but it might crash for someone else… Instead, use an external files etc. I don’t know specifics yet. :stuck_out_tongue:

“Access violation writing location 0xDCFFAEEA.” probably means you’re writing to a dangling pointer - this will just be a plain old bug in your code that’s only getting triggered under certain circumstances. But the size of the binary data will never itself cause a crash.

Thanks… This was far more embarassing than… I dare to agree. :smiley:

Same problem happened even when I loaded the samples straight from wavefiles to memory…

Turns out I had an array too small that was collecting the samples…