[vlc-commits] DirectSound: use calloc for aout_stream_sys_t
Felix Abecassis
git at videolan.org
Fri Feb 28 17:24:44 CET 2014
vlc | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Fri Feb 28 15:54:54 2014 +0100| [5ef694fb37e95c5b75107585486e50fb1397adcf] | committer: Rémi Denis-Courmont
DirectSound: use calloc for aout_stream_sys_t
Fix a crash occurring when CreateDSBufferPCM() fails in Start() and
afterwards Stop() uses uninitialized pointer values when releasing
objects.
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5ef694fb37e95c5b75107585486e50fb1397adcf
---
modules/audio_output/directsound.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/audio_output/directsound.c b/modules/audio_output/directsound.c
index c7ab2e3..b2a9ca6 100644
--- a/modules/audio_output/directsound.c
+++ b/modules/audio_output/directsound.c
@@ -747,7 +747,7 @@ static HRESULT StreamStart( aout_stream_t *s,
audio_sample_format_t *restrict fmt,
const GUID *sid )
{
- aout_stream_sys_t *sys = malloc( sizeof( *sys ) );
+ aout_stream_sys_t *sys = calloc( 1, sizeof( *sys ) );
if( unlikely(sys == NULL) )
return E_OUTOFMEMORY;
More information about the vlc-commits
mailing list