Commit 97020e0c authored by Hannes Domani's avatar Hannes Domani Committed by Jean-Baptiste Kempf

avformat: fix memory leak

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 26e38c7d
......@@ -270,7 +270,7 @@ int OpenDemux( vlc_object_t *p_this )
p_sys->io_buffer = xmalloc( p_sys->io_buffer_size );
p_sys->ic = avformat_alloc_context();
p_sys->ic->pb = avio_alloc_context( p_sys->io_buffer,
AVIOContext *pb = p_sys->ic->pb = avio_alloc_context( p_sys->io_buffer,
p_sys->io_buffer_size, 0, p_demux, IORead, NULL, IOSeek );
p_sys->ic->pb->seekable = b_can_seek ? AVIO_SEEKABLE_NORMAL : 0;
error = avformat_open_input(&p_sys->ic, psz_url, p_sys->fmt, NULL);
......@@ -279,6 +279,7 @@ int OpenDemux( vlc_object_t *p_this )
{
msg_Err( p_demux, "Could not open %s: %s", psz_url,
vlc_strerror_c(AVUNERROR(error)) );
av_free( pb );
p_sys->ic = NULL;
free( psz_url );
CloseDemux( p_this );
......
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