Commit fc5b6ff9 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

remoteosd: close connection immediately if picture allocation fails

parent f332147f
...@@ -587,14 +587,19 @@ static void* vnc_worker_thread( void *obj ) ...@@ -587,14 +587,19 @@ static void* vnc_worker_thread( void *obj )
} }
/* Create an empty picture for VNC the data */ /* Create an empty picture for VNC the data */
vlc_mutex_lock( &p_sys->lock ); picture_t *pic = picture_New( VLC_CODEC_YUVA, p_sys->i_vnc_width,
p_sys->i_socket = fd; p_sys->i_vnc_height, 1, 1 );
p_sys->p_pic = picture_New( VLC_CODEC_YUVA, if( likely(pic != NULL) )
p_sys->i_vnc_width, p_sys->i_vnc_height, 1, 1 ); {
vlc_mutex_unlock( &p_sys->lock ); vlc_mutex_lock( &p_sys->lock );
if( !p_sys->p_pic ) p_sys->i_socket = fd;
p_sys->p_pic = pic;
vlc_mutex_unlock( &p_sys->lock );
}
else
{ {
goto exit; net_Close( fd );
return NULL;
} }
write_update_request( p_filter, false ); write_update_request( p_filter, false );
...@@ -671,8 +676,6 @@ static void* vnc_worker_thread( void *obj ) ...@@ -671,8 +676,6 @@ static void* vnc_worker_thread( void *obj )
vlc_join( update_request_thread_handle, NULL ); vlc_join( update_request_thread_handle, NULL );
} }
exit:
msg_Dbg( p_filter, "VNC message reader thread ended" ); msg_Dbg( p_filter, "VNC message reader thread ended" );
vlc_restorecancel (canc); vlc_restorecancel (canc);
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment