[FFmpeg-cvslog] pulseaudio: move NULL check up before dereference.

Reimar Döffinger git at videolan.org
Sun Apr 6 19:40:06 CEST 2014


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Sun Apr  6 19:31:45 2014 +0200| [57d10a28f41b3cb6d43be02d10614ac993cc79b9] | committer: Reimar Döffinger

pulseaudio: move NULL check up before dereference.

Fixes CID 1197068.

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=57d10a28f41b3cb6d43be02d10614ac993cc79b9
---

 libavdevice/pulse_audio_common.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavdevice/pulse_audio_common.c b/libavdevice/pulse_audio_common.c
index cfe97bc..696cb62 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))) {



More information about the ffmpeg-cvslog mailing list