Commit f9db0ea1 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

fix seg'faulty sout_StreamChainDelete ordering

We must delete from the head to the tail, the opposite of the creation
order. This stems from the fact that an stream output object "sees" the
next element, and may try to use it while being deleted.

The crash was easily reproducible with:
vlc --sout-keep --sout '#duplicate{dst=gather:std{mux=ts,dst=/dev/null}}' \
    -I oldrc -vv raw_es.mp2
parent b4219e32
......@@ -815,10 +815,11 @@ void sout_StreamChainDelete(sout_stream_t *p_first, sout_stream_t *p_last)
if(p_first != p_last)
sout_StreamChainDelete(p_first->p_next, p_last);
sout_stream_t *p_next = p_first->p_next;
if(p_first != p_last)
sout_StreamChainDelete(p_next, p_last);
/* Create a "stream_out" module, which may forward its ES to p_next module */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment