[vlc-commits] avformat: fix NULL dereference
Rémi Denis-Courmont
git at videolan.org
Fri Aug 28 20:38:06 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Aug 28 21:35:00 2015 +0300| [13ba7e5ea4524b029e30e526281b21aa7f75ab49] | committer: Rémi Denis-Courmont
avformat: fix NULL dereference
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=13ba7e5ea4524b029e30e526281b21aa7f75ab49
---
modules/demux/avformat/demux.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 823d9f9..5211aaa 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -169,10 +169,14 @@ int OpenDemux( vlc_object_t *p_this )
psz_url = strdup( p_demux->psz_file );
else
{
- if( asprintf( &psz_url, "%s://%s", p_demux->psz_access, p_demux->psz_location ) == -1)
- return VLC_ENOMEM;
+ if( asprintf( &psz_url, "%s://%s", p_demux->psz_access,
+ p_demux->psz_location ) == -1)
+ psz_url = NULL;
}
- msg_Dbg( p_demux, "trying url: %s", psz_url );
+
+ if( psz_url != NULL )
+ msg_Dbg( p_demux, "trying url: %s", psz_url );
+
/* Init Probe data */
pd.filename = psz_url;
if( ( pd.buf_size = stream_Peek( p_demux->s, (const uint8_t**)&pd.buf, 2048 + 213 ) ) <= 0 )
More information about the vlc-commits
mailing list