Fix uninitialized memory with sndfile
This commit is contained in:
parent
af21c5775d
commit
afba7e4bc7
1 changed files with 3 additions and 0 deletions
|
|
@ -12,6 +12,7 @@
|
|||
#endif
|
||||
#include <sndfile.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
struct st_audio_file {
|
||||
SNDFILE* snd;
|
||||
|
|
@ -24,6 +25,8 @@ st_audio_file* st_open_file(const char* filename)
|
|||
if (!af)
|
||||
return NULL;
|
||||
|
||||
memset(&af->info, 0, sizeof(SF_INFO));
|
||||
|
||||
af->snd = sf_open(filename, SFM_READ, &af->info);
|
||||
if (!af->snd) {
|
||||
free(af);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue