gecko/media/libsydneyaudio/478299_zeromem_sa_stream.patch
Chris Pearce 6582a15604 Bug 478299. Zero out stream memory in libsydneyaudio so we don't crash when cleaning it up. r+sr=roc
--HG--
extra : rebase_source : fd1b92c236fca4d0e9d42b01a4bec64b46d21b84
2009-02-19 21:06:59 +13:00

23 lines
751 B
Diff

diff --git a/media/libsydneyaudio/src/sydney_audio_waveapi.c b/media/libsydneyaudio/src/sydney_audio_waveapi.c
--- a/media/libsydneyaudio/src/sydney_audio_waveapi.c
+++ b/media/libsydneyaudio/src/sydney_audio_waveapi.c
@@ -147,17 +147,17 @@ int sa_stream_create_pcm(sa_stream_t **s
if (format != SA_PCM_FORMAT_S16_NE) {
return SA_ERROR_NOT_SUPPORTED;
}
if (mode != SA_MODE_WRONLY) {
return SA_ERROR_NOT_SUPPORTED;
}
- if ((_s = (sa_stream_t*)malloc(sizeof(sa_stream_t))) == NULL) {
+ if ((_s = (sa_stream_t*)calloc(1, sizeof(sa_stream_t))) == NULL) {
return SA_ERROR_OOM;
}
_s->rwMode = mode;
_s->format = format;
_s->rate = rate;
_s->channels = nchannels;
_s->deviceName = DEFAULT_DEVICE_NAME;