[vlc-devel] [vlc-commits] fingerprinter: fix incorrect error cleanup

RĂ©mi Denis-Courmont remi at remlab.net
Sun Jul 24 22:44:17 CEST 2016


Le sunnuntaina 24. heinäkuuta 2016, 22.38.04 EEST Francois Cartegnie a écrit :
> vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Jul 24
> 21:26:17 2016 +0200| [ba0d3f1a26832535eacfed5c74bef517caa639e7] |
> committer: Francois Cartegnie
> 
> fingerprinter: fix incorrect error cleanup
> 
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ba0d3f1a26832535eac
> > fed5c74bef517caa639e7
> ---
> 
>  modules/misc/fingerprinter.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/modules/misc/fingerprinter.c b/modules/misc/fingerprinter.c
> index 043331e..6cacbc0 100644
> --- a/modules/misc/fingerprinter.c
> +++ b/modules/misc/fingerprinter.c
> @@ -217,7 +217,7 @@ static int Open(vlc_object_t *p_this)
>      return VLC_SUCCESS;
> 
>  error:
> -    free( p_sys );
> +    Close( p_this );
>      return VLC_EGENERIC;
>  }
> 
> @@ -229,8 +229,11 @@ static void Close(vlc_object_t *p_this)
>      fingerprinter_thread_t   *p_fingerprinter = (fingerprinter_thread_t*)
> p_this; fingerprinter_sys_t *p_sys = p_fingerprinter->p_sys;
> 
> -    vlc_cancel( p_sys->thread );
> -    vlc_join( p_sys->thread, NULL );
> +    if( p_sys->thread )

I don´t think so.

"All of the types shall be defined as arithmetic types of an appropriate 
length, with the following exceptions: (...) pthread_t (...)"
(http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html)

typedef pthread_t       vlc_thread_t;


> +    {
> +        vlc_cancel( p_sys->thread );
> +        vlc_join( p_sys->thread, NULL );
> +    }
> 
>      for ( int i = 0; i < vlc_array_count( p_sys->incoming.queue ); i++ )
>          fingerprint_request_Delete( vlc_array_item_at_index(
> p_sys->incoming.queue, i ) );
> 
> _______________________________________________
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits


-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list