Merge coderkun's array size fixes, close #176

main
Harry van Haaren 2017-04-09 14:07:24 +01:00
commit 22582c8f20
2 changed files with 2 additions and 2 deletions

View File

@ -167,7 +167,7 @@ int DiskReader::loadSample( int track, int scene, string path )
int chnls = infile.channels();
std::vector<float> bufL( infile.frames() );
std::vector<float> bufR( infile.frames() );
float frameBuf[ sizeof(float) * chnls ];
float frameBuf[ chnls ];
if ( infile.error() ) {
LUPPP_ERROR("File %s, Error %s", path.c_str(), infile.strError() );

View File

@ -321,7 +321,7 @@ int DiskWriter::writeAudioBuffer(int track, int scene, AudioBuffer* ab,
// FIXME: the size of the buffer is bigger than the audio contained in it:
// calculate the length that needs saving using getBeats() * framesPerBeat
if ( ab->getAudioFrames() > 0 ) {
float frameBuf[ sizeof(float) * 2 ];
float frameBuf[ 2 ];
for(int i=0; i<ab->getAudioFrames(); i++) {
frameBuf[0] = ab->getDataL()[i];
frameBuf[1] = ab->getDataR()[i];