[vlc-devel] [PATCH] stream: release peek block after destroy
Rémi Denis-Courmont
remi at remlab.net
Sat Aug 29 18:55:36 CEST 2015
On Saturday 29 August 2015 18:47:17 Francois Cartegnie wrote:
> stream_Demux currently segfaults on deletion because the
> associated demux thread dereferences the previously
> freed peek buffer.
Well, probably true... but by the same train of logic, the iconv handle should
be retained too.
> ---
> 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);
> }
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list