aboutsummaryrefslogtreecommitdiff
path: root/libavdevice/pulse_audio_common.c
diff options
context:
space:
mode:
authorReimar Döffinger2014-04-06 19:31:45 +0200
committerReimar Döffinger2014-04-06 19:38:51 +0200
commit57d10a28f41b3cb6d43be02d10614ac993cc79b9 (patch)
tree92469dcffd9e5677b7622554520da5587dc38fed /libavdevice/pulse_audio_common.c
parentfc7e02f0ff345d5331b7c78f2400668d2c79a8b0 (diff)
pulseaudio: move NULL check up before dereference.
Fixes CID 1197068. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavdevice/pulse_audio_common.c')
-rw-r--r--libavdevice/pulse_audio_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavdevice/pulse_audio_common.c b/libavdevice/pulse_audio_common.c
index cfe97bc7cb..696cb62b43 100644
--- a/libavdevice/pulse_audio_common.c
+++ b/libavdevice/pulse_audio_common.c
@@ -148,10 +148,10 @@ int ff_pulse_audio_get_devices(AVDeviceInfoList *devices, const char *server, in
dev_list.output = output;
dev_list.devices = devices;
- devices->nb_devices = 0;
- devices->devices = NULL;
if (!devices)
return AVERROR(EINVAL);
+ devices->nb_devices = 0;
+ devices->devices = NULL;
if (!(pa_ml = pa_mainloop_new()))
return AVERROR(ENOMEM);
if (!(pa_mlapi = pa_mainloop_get_api(pa_ml))) {