[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v1.0-dev-31-gd28fc0d
Colin Guthrie
gitmailer-noreply at 0pointer.de
Wed Dec 22 07:09:13 PST 2010
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from fb05059acf687405c9a545480b680f1bcc1a229c (commit)
- Log -----------------------------------------------------------------
d28fc0d coreaudio: Make coreaudio-detect safer by adding asserts before dereferencing
-----------------------------------------------------------------------
Summary of changes:
src/modules/coreaudio/module-coreaudio-detect.c | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
-----------------------------------------------------------------------
commit d28fc0df8997fed0da9ac3f54138f792dc660841
Author: Cai Yuanqing <Yuanqing.Cai at tieto.com>
Date: Tue Dec 21 13:59:06 2010 +0800
coreaudio: Make coreaudio-detect safer by adding asserts before dereferencing
diff --git a/src/modules/coreaudio/module-coreaudio-detect.c b/src/modules/coreaudio/module-coreaudio-detect.c
index 6172a18..c23079a 100644
--- a/src/modules/coreaudio/module-coreaudio-detect.c
+++ b/src/modules/coreaudio/module-coreaudio-detect.c
@@ -62,12 +62,13 @@ static int ca_device_added(struct pa_module *m, AudioObjectID id) {
AudioObjectPropertyAddress property_address;
OSStatus err;
pa_module *mod;
- struct userdata *u = m->userdata;
+ struct userdata *u;
struct ca_device *dev;
char *args, tmp[64];
UInt32 size;
- pa_assert(u);
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
/* To prevent generating a black hole that will suck us in,
don't create sources/sinks for PulseAudio virtual devices */
@@ -108,9 +109,10 @@ static int ca_update_device_list(struct pa_module *m) {
UInt32 i, size, num_devices;
AudioDeviceID *device_id;
struct ca_device *dev;
- struct userdata *u = m->userdata;
+ struct userdata *u;
- pa_assert(u);
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
property_address.mSelector = kAudioHardwarePropertyDevices;
property_address.mScope = kAudioObjectPropertyScopeGlobal;
@@ -202,6 +204,8 @@ int pa__init(pa_module *m) {
struct userdata *u = pa_xnew0(struct userdata, 1);
AudioObjectPropertyAddress property_address;
+ pa_assert(m);
+
m->userdata = u;
property_address.mSelector = kAudioHardwarePropertyDevices;
@@ -227,11 +231,12 @@ fail:
}
void pa__done(pa_module *m) {
- struct userdata *u = m->userdata;
+ struct userdata *u;
struct ca_device *dev = u->devices;
AudioObjectPropertyAddress property_address;
- pa_assert(u);
+ pa_assert(m);
+ pa_assert_se(u = m->userdata);
property_address.mSelector = kAudioHardwarePropertyDevices;
property_address.mScope = kAudioObjectPropertyScopeGlobal;
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list