[vlc-commits] udp: fix potential deadlock at exit

Rémi Denis-Courmont git at videolan.org
Wed Feb 25 18:56:36 CET 2015


vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Feb 24 23:12:28 2015 +0200| [d6cf63b14d410a38401bcaff6f026cfb0ec9be0e] | committer: Jean-Baptiste Kempf

udp: fix potential deadlock at exit

(cherry picked from commit 613ea43a83ed745a9dd58ebce89607b98dbe894c)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/access/udp.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/access/udp.c b/modules/access/udp.c
index 00f2989..8139d05 100644
--- a/modules/access/udp.c
+++ b/modules/access/udp.c
@@ -232,8 +232,14 @@ static int Control( access_t *p_access, int i_query, va_list args )
 static block_t *BlockUDP( access_t *p_access )
 {
     access_sys_t *sys = p_access->p_sys;
+    block_t *block;
 
-    return block_FifoGet( sys->fifo );
+    if( p_access->info.b_eof )
+        return NULL;
+
+    block = block_FifoGet( sys->fifo );
+    p_access->info.b_eof = block == NULL;
+    return block;
 }
 
 /*****************************************************************************



More information about the vlc-commits mailing list