[vlc-devel] [PATCH] stream: release peek block after destroy

Francois Cartegnie fcvlcdev at free.fr
Sat Aug 29 18:47:17 CEST 2015


stream_Demux currently segfaults on deletion because the
associated demux thread dereferences the previously
freed peek buffer.

---
 src/input/stream.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/input/stream.c b/src/input/stream.c
index beb8817..fa74400 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -92,12 +92,13 @@ void stream_Delete(stream_t *s)
 
     if (priv->text.conv != (vlc_iconv_t)(-1))
         vlc_iconv_close(priv->text.conv);
-    if (priv->peek != NULL)
-        block_Release(priv->peek);
 
     if (s->pf_destroy != NULL)
         s->pf_destroy(s);
 
+    if (priv->peek != NULL)
+        block_Release(priv->peek);
+
     free(s->psz_url);
     vlc_object_release(s);
 }
-- 
2.4.3



More information about the vlc-devel mailing list