pulseaudio: move NULL check up before dereference.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sun, 6 Apr 2014 17:31:45 +0000 (19:31 +0200)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sun, 6 Apr 2014 17:38:51 +0000 (19:38 +0200)
Fixes CID 1197068.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
libavdevice/pulse_audio_common.c

index cfe97bc..696cb62 100644 (file)
@@ -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))) {