Browse code

pulseaudio: move NULL check up before dereference.

Fixes CID 1197068.

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

Reimar Döffinger authored on 2014/04/07 02:31:45
Showing 1 changed files
... ...
@@ -148,10 +148,10 @@ int ff_pulse_audio_get_devices(AVDeviceInfoList *devices, const char *server, in
148 148
 
149 149
     dev_list.output = output;
150 150
     dev_list.devices = devices;
151
-    devices->nb_devices = 0;
152
-    devices->devices = NULL;
153 151
     if (!devices)
154 152
         return AVERROR(EINVAL);
153
+    devices->nb_devices = 0;
154
+    devices->devices = NULL;
155 155
     if (!(pa_ml = pa_mainloop_new()))
156 156
         return AVERROR(ENOMEM);
157 157
     if (!(pa_mlapi = pa_mainloop_get_api(pa_ml))) {