зеркало из https://github.com/mozilla/pjs.git
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
This commit is contained in:
Родитель
c25885d8f0
Коммит
ab458737bf
|
@ -0,0 +1,22 @@
|
||||||
|
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;
|
|
@ -9,3 +9,5 @@ The svn revision number used was r3827.
|
||||||
|
|
||||||
The patch from Annodex trac ticket #427 (http://trac.annodex.net/ticket/447)
|
The patch from Annodex trac ticket #427 (http://trac.annodex.net/ticket/447)
|
||||||
was applied to fix bug #469698.
|
was applied to fix bug #469698.
|
||||||
|
|
||||||
|
Also applied patch for bug 478299.
|
||||||
|
|
|
@ -152,7 +152,7 @@ int sa_stream_create_pcm(sa_stream_t **s,
|
||||||
return SA_ERROR_NOT_SUPPORTED;
|
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;
|
return SA_ERROR_OOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,3 +6,4 @@ cp $1/include/sydney_audio.h include/sydney_audio.h
|
||||||
cp $1/src/*.c src/
|
cp $1/src/*.c src/
|
||||||
cp $1/AUTHORS ./AUTHORS
|
cp $1/AUTHORS ./AUTHORS
|
||||||
patch -p3 < 469698_mac_stream_endian.patch
|
patch -p3 < 469698_mac_stream_endian.patch
|
||||||
|
patch -p3 < 478299_zeromem_sa_stream.patch
|
||||||
|
|
Загрузка…
Ссылка в новой задаче