[vlc-commits] avformat: fix NULL dereference

Rémi Denis-Courmont git at videolan.org
Wed Oct 21 18:56:59 CEST 2015


vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Aug 28 21:35:00 2015 +0300| [1bfd952f6295056240e0e2337f43807d95737732] | committer: Jean-Baptiste Kempf

avformat: fix NULL dereference

(cherry picked from commit 13ba7e5ea4524b029e30e526281b21aa7f75ab49)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=1bfd952f6295056240e0e2337f43807d95737732
---

 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 9a1c415..df92ea8 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