ofOpenALSoundPlayer variables initialization correction

Hi guys,

I don’t know if here is the best place for improvements suggestion, so let me know if there is a better way to help the development community.

SF_INFO struct is not being initialized and as you know is not a good practice related with memmory handling.
It’s the only error that I get running valgrind with OF applications so far.

To correct this, I simply added the following line :

memset (&sfInfo, 0, sizeof (sfInfo));

after SF_INFO sfInfo declaration.

bool ofOpenALSoundPlayer::sfReadFile(string path, vector & buffer, vector & fftAuxBuffer){
SF_INFO sfInfo;
// Added this line
memset (&sfInfo, 0, sizeof (sfInfo));
SNDFILE* f = sf_open(path.c_str(),SFM_READ,&sfInfo);
ofLogError(“ofOpenALSoundPlayer”) << “sfReadFile(): couldn’t read “” << path << “””;
return false;



If it’s of your interest, great then…

All the best,