Skip to content
Snippets Groups Projects
Commit e452063d authored by Zhao Zhili's avatar Zhao Zhili Committed by Hugo Beauzée-Luyssen
Browse files

srt: initialize p_sys->sock to SRT_INVALID_SOCK

Otherwise the zero initialized p_sys->sock will be closed in
srt_schedule_reconnect().
parent 52e3f716
No related branches found
Tags 3.5.0
No related merge requests found
......@@ -381,6 +381,7 @@ static int Open(vlc_object_t *p_this)
msg_Err( p_stream, "Failed to create poll id for SRT socket." );
goto failed;
}
p_sys->sock = SRT_INVALID_SOCK;
if ( !srt_schedule_reconnect( p_stream ) )
{
......@@ -395,7 +396,7 @@ static int Open(vlc_object_t *p_this)
return VLC_SUCCESS;
failed:
if ( p_sys->sock != -1 ) srt_close( p_sys->sock );
if ( p_sys->sock != SRT_INVALID_SOCK ) srt_close( p_sys->sock );
if ( p_sys->i_poll_id != -1 ) srt_epoll_release( p_sys->i_poll_id );
srt_cleanup();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment