[vlc-commits] access: rdp: fix URI parsing

Simon Latapie git at videolan.org
Thu Mar 28 12:57:51 CET 2019


vlc/vlc-3.0 | branch: master | Simon Latapie <garf at videolan.org> | Mon Mar 25 19:42:36 2019 +0100| [2ca0a1013b122e4f420dc5f72b2da882e60259ea] | committer: Hugo Beauzée-Luyssen

access: rdp: fix URI parsing

In 3.0 branch, demux_t does not contain psz_url

(manually cherry-picked from cee9f5692b0a14cdaf7c32564f0b3b0a2011805c)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=2ca0a1013b122e4f420dc5f72b2da882e60259ea
---

 modules/access/rdp.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/access/rdp.c b/modules/access/rdp.c
index 2992090219..fcb0c80490 100644
--- a/modules/access/rdp.c
+++ b/modules/access/rdp.c
@@ -457,7 +457,14 @@ static int Open( vlc_object_t *p_this )
 
     /* Parse uri params for pre-connect */
     vlc_url_t url;
-    vlc_UrlParse( &url, p_demux->psz_location );
+    char *psz_url;
+    if ( asprintf( &psz_url, "%s://%s", p_demux->psz_access, p_demux->psz_location ) == -1 )
+    {
+        msg_Err( p_demux, "cannot allocate memory" );
+        goto error;
+    }
+    vlc_UrlParse( &url, psz_url );
+    free(psz_url);
 
     if ( !EMPTY_STR(url.psz_host) )
         p_sys->psz_hostname = strdup( url.psz_host );



More information about the vlc-commits mailing list