[vlc-commits] ftp: Don't assert on a valid connection handle in Read()

Hugo Beauzée-Luyssen git at videolan.org
Fri Mar 9 15:10:33 CET 2018


vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Mar  8 13:45:19 2018 +0100| [188a032c674389047ebec156e2518e2b9e6d5683] | committer: Hugo Beauzée-Luyssen

ftp: Don't assert on a valid connection handle in Read()

When seeking, if the reconnection fails, the connection handle will be
NULL. Instead, try to reconnect and signal EOF if this can't be done.

(cherry picked from commit dde0b69477551eea6d2e647e90be9459b5c3f91c)
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=188a032c674389047ebec156e2518e2b9e6d5683
---

 modules/access/ftp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/access/ftp.c b/modules/access/ftp.c
index a5ad4ddabd..8100bf8444 100644
--- a/modules/access/ftp.c
+++ b/modules/access/ftp.c
@@ -900,7 +900,8 @@ static ssize_t Read( stream_t *p_access, void *p_buffer, size_t i_len )
 {
     access_sys_t *p_sys = p_access->p_sys;
 
-    assert( p_sys->data != NULL );
+    if( p_sys->data == NULL )
+        return 0;
     assert( !p_sys->out );
 
     ssize_t i_read = vlc_tls_Read( p_sys->data, p_buffer, i_len, false );



More information about the vlc-commits mailing list