Commit 96158ea0 authored by Pierre Ynard's avatar Pierre Ynard

avformat: fix use-after-free in error path

(cherry picked from commit 50fe8e1180d012caf19d421229143344d4242405)
Signed-off-by: default avatarPierre Ynard <linkfanel@yahoo.fr>
parent 3ce813b2
......@@ -241,15 +241,16 @@ int OpenDemux( vlc_object_t *p_this )
error = av_open_input_stream(&p_sys->ic, &p_sys->io, psz_url, p_sys->fmt, NULL);
#endif
free( psz_url );
if( error < 0 )
{
errno = AVUNERROR(error);
msg_Err( p_demux, "Could not open %s: %m", psz_url );
p_sys->ic = NULL;
free( psz_url );
CloseDemux( p_this );
return VLC_EGENERIC;
}
free( psz_url );
vlc_avcodec_lock(); /* avformat calls avcodec behind our back!!! */
#if LIBAVFORMAT_VERSION_INT >= ((53<<16)+(26<<8)+0)
......
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