[vlc-devel] [PATCH 06/11] demux: wav: change data_pos sign

Remi Denis-Courmont remi at remlab.net
Thu Mar 12 17:36:46 CET 2020


Le 2020-03-12 16:05, Thomas Guillem a écrit :
> Use the same type than vlc_stream_Tell().
> ---
>  modules/demux/wav.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/modules/demux/wav.c b/modules/demux/wav.c
> index c8829648730..5997a3c1865 100644
> --- a/modules/demux/wav.c
> +++ b/modules/demux/wav.c
> @@ -46,7 +46,7 @@ typedef struct
>      es_format_t     fmt;
>      es_out_id_t     *p_es;
> 
> -    int64_t         i_data_pos;
> +    uint64_t        i_data_pos;
>      int64_t         i_data_size;
> 
>      unsigned int    i_frame_size;
> @@ -594,7 +594,8 @@ static int Open( vlc_object_t * p_this )
>      if( !b_is_rf64 || i_size < UINT32_MAX )
>      {
>          int64_t i_stream_size = stream_Size( p_demux->s );
> -        if( i_stream_size > 0 && i_stream_size >= i_size + 
> p_sys->i_data_pos )
> +        if( i_stream_size > 0
> +         && (uint64_t) i_stream_size >= i_size + p_sys->i_data_pos )
>              p_sys->i_data_size = i_size;
>      }

Do you really still need to special case 0 ?

-- 
Rémi Denis-Courmont


More information about the vlc-devel mailing list