Fix uninitialized memory with sndfile

This commit is contained in:
Jean Pierre Cimalando 2020-11-24 20:56:00 +01:00
parent af21c5775d
commit afba7e4bc7

View file

@ -12,6 +12,7 @@
#endif #endif
#include <sndfile.h> #include <sndfile.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
struct st_audio_file { struct st_audio_file {
SNDFILE* snd; SNDFILE* snd;
@ -24,6 +25,8 @@ st_audio_file* st_open_file(const char* filename)
if (!af) if (!af)
return NULL; return NULL;
memset(&af->info, 0, sizeof(SF_INFO));
af->snd = sf_open(filename, SFM_READ, &af->info); af->snd = sf_open(filename, SFM_READ, &af->info);
if (!af->snd) { if (!af->snd) {
free(af); free(af);