[vlc-devel] [PATCH] mp4: meta: fix format-truncation warning

Alexandre Janniaux ajanni at videolabs.io
Tue Sep 10 10:17:29 CEST 2019


Hi,

Small ping for the patch,

Regards,
--
Alexandre Janniaux
Videolabs

On Thu, Sep 05, 2019 at 12:25:22AM +0200, Alexandre Janniaux wrote:
> PRIu16 can go up to 65535, so it's 6 char when counting the null one.
> ---
>  modules/demux/mp4/meta.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/modules/demux/mp4/meta.c b/modules/demux/mp4/meta.c
> index bf4ed2a88f..3288549244 100644
> --- a/modules/demux/mp4/meta.c
> +++ b/modules/demux/mp4/meta.c
> @@ -394,7 +394,7 @@ static void SetupmdirMeta( vlc_meta_t *p_meta, MP4_Box_t *p_box )
>          if ( BOXDATA(p_data)->i_blob >= 6 &&
>               BOXDATA(p_data)->e_wellknowntype == DATA_WKT_RESERVED )
>          {
> -            char psz_number[5];
> +            char psz_number[6];
>              snprintf( psz_number, sizeof( psz_number ), "%"PRIu16, GetWBE(&BOXDATA(p_data)->p_blob[2]) );
>              vlc_meta_Set( p_meta, vlc_meta_DiscNumber, psz_number );
>              snprintf( psz_number, sizeof( psz_number ), "%"PRIu16, GetWBE(&BOXDATA(p_data)->p_blob[4]) );
> --
> 2.23.0
>


More information about the vlc-devel mailing list