Skip to content
Snippets Groups Projects
Commit e38a9bd1 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3757] Test new (malloc)

parent 5536345c
No related branches found
No related tags found
No related merge requests found
...@@ -374,6 +374,10 @@ bool WaveFile::openExistingWaveFile (const std::string& fileName, int audioSampl ...@@ -374,6 +374,10 @@ bool WaveFile::openExistingWaveFile (const std::string& fileName, int audioSampl
_file_size = 60*srate; _file_size = 60*srate;
SFLDataFormat *tempBuffer = new SFLDataFormat[_file_size]; SFLDataFormat *tempBuffer = new SFLDataFormat[_file_size];
if (!tempBuffer)
return false;
SFLDataFormat *tempBufferRsmpl = NULL; SFLDataFormat *tempBufferRsmpl = NULL;
_file_stream.read ( (char *) tempBuffer, _file_size*sizeof (SFLDataFormat)); _file_stream.read ( (char *) tempBuffer, _file_size*sizeof (SFLDataFormat));
...@@ -394,6 +398,10 @@ bool WaveFile::openExistingWaveFile (const std::string& fileName, int audioSampl ...@@ -394,6 +398,10 @@ bool WaveFile::openExistingWaveFile (const std::string& fileName, int audioSampl
int remainingSamples = _file_size; int remainingSamples = _file_size;
tempBufferRsmpl = new SFLDataFormat[nbSample]; tempBufferRsmpl = new SFLDataFormat[nbSample];
if (!tempBufferRsmpl)
return false;
SFLDataFormat *in = tempBuffer; SFLDataFormat *in = tempBuffer;
SFLDataFormat *out = tempBufferRsmpl; SFLDataFormat *out = tempBufferRsmpl;
...@@ -416,6 +424,10 @@ bool WaveFile::openExistingWaveFile (const std::string& fileName, int audioSampl ...@@ -416,6 +424,10 @@ bool WaveFile::openExistingWaveFile (const std::string& fileName, int audioSampl
// Init audio loop buffer info // Init audio loop buffer info
_buffer = new SFLDataFormat[nbSample]; _buffer = new SFLDataFormat[nbSample];
if (!_buffer)
return false;
_size = nbSample; _size = nbSample;
_sampleRate = (int) audioSamplingRate; _sampleRate = (int) audioSamplingRate;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment