From afba7e4bc712d00b0439d6837d23a0ebbb91bec8 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Tue, 24 Nov 2020 20:56:00 +0100 Subject: [PATCH] Fix uninitialized memory with sndfile --- external/st_audiofile/src/st_audiofile_sndfile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/external/st_audiofile/src/st_audiofile_sndfile.c b/external/st_audiofile/src/st_audiofile_sndfile.c index c1b8fed8..31cc115d 100644 --- a/external/st_audiofile/src/st_audiofile_sndfile.c +++ b/external/st_audiofile/src/st_audiofile_sndfile.c @@ -12,6 +12,7 @@ #endif #include #include +#include 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);