vlc | branch: master | Jean-Paul Saman <jean-paul.sa...@m2x.nl> | Wed Dec 11 
15:54:36 2013 +0100| [4a1493db19bb1db6a57b49bed385764a7d41793e] | committer: 
Jean-Paul Saman

access/alsa.c: fix racecondition on demux->p_sys variable

The Thread() function could access demux->p_sys before it was assigned a value 
other then NULL.
If this happens then it will crash on line 158 while accessing sys->pcm.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4a1493db19bb1db6a57b49bed385764a7d41793e
---

 modules/access/alsa.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/access/alsa.c b/modules/access/alsa.c
index d82ae18..1125545 100644
--- a/modules/access/alsa.c
+++ b/modules/access/alsa.c
@@ -480,6 +480,7 @@ static int Open (vlc_object_t *obj)
     /* Kick recording */
     aout_FormatPrepare (&fmt.audio);
     sys->es = es_out_Add (demux->out, &fmt);
+    demux->p_sys = sys;
 
     if (vlc_clone (&sys->thread, Thread, demux, VLC_THREAD_PRIORITY_INPUT))
     {
@@ -487,7 +488,6 @@ static int Open (vlc_object_t *obj)
         goto error;
     }
 
-    demux->p_sys = sys;
     demux->pf_demux = NULL;
     demux->pf_control = Control;
     return VLC_SUCCESS;

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to