[vlc-commits] ftp: Don't assert on a valid connection handle in Read()
Hugo Beauzée-Luyssen
git at videolan.org
Fri Mar 9 11:24:44 CET 2018
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Mar 8 13:45:19 2018 +0100| [dde0b69477551eea6d2e647e90be9459b5c3f91c] | 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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dde0b69477551eea6d2e647e90be9459b5c3f91c
---
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