[vlc-devel] [PATCH 1/2] mosaic_bridge: fix format-overflow warning

Alexandre Janniaux ajanni at videolabs.io
Thu Sep 5 12:18:29 CEST 2019


Hi,

On Thu, Sep 05, 2019 at 12:14:39PM +0200, Steve Lhomme wrote:
> On 2019-09-05 11:27, Alexandre Janniaux wrote:
> > Hi,
> >
> > This is an undefined behaviour, which might display (null), NULL or just
> > break completely. But I can print NULL instead, it would just be weird as
> > you can have a filter called NULL. Maybe putting \" \" around would be
> > better in this case ?
>
> Rather '%s'.
>
> We probably have a lot of placing passing NULL when displaying strings.
>

I'm currently fixing those warnings and fixed almost all of them.
Do you mean putting ' around instead of " ?

Regards,
--
Alexandre Janniaux
Videolabs

>
> > Regards,
> > --
> > Alexandre Janniaux
> > Videolabs
> >
> > On Thu, Sep 05, 2019 at 08:17:36AM +0200, Steve Lhomme wrote:
> > > Isn't it supposed to translate a NULL pointer to "NULL" ?
> > >
> > > On 2019-09-05 1:35, Alexandre Janniaux wrote:
> > > > ---
> > > >    modules/stream_out/mosaic_bridge.c | 5 +++--
> > > >    1 file changed, 3 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
> > > > index fa5d00c259..d54a3d15c7 100644
> > > > --- a/modules/stream_out/mosaic_bridge.c
> > > > +++ b/modules/stream_out/mosaic_bridge.c
> > > > @@ -386,7 +386,7 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
> > > >        };
> > > >
> > > >        psz_chain = var_GetNonEmptyString( p_stream, CFG_PREFIX "vfilter" );
> > > > -    msg_Dbg( p_stream, "psz_chain: %s", psz_chain );
> > > > +    msg_Dbg( p_stream, "psz_chain: %s", psz_chain ? psz_chain : "");
> > > >        if( psz_chain )
> > > >        {
> > > >            filter_owner_t owner = {
> > > > @@ -581,7 +581,8 @@ inline static int video_update_format_decoder( decoder_t *p_dec )
> > > >        {
> > > >            // update the filter after the format changed/is known
> > > >            char *psz_chain = var_GetNonEmptyString( p_owner->p_stream, CFG_PREFIX "vfilter" );
> > > > -        msg_Dbg( p_owner->p_stream, "update filter: %s", psz_chain );
> > > > +        msg_Dbg( p_owner->p_stream, "update filter: %s",
> > > > +                 psz_chain ?  psz_chain : "" );
> > > >            if( psz_chain )
> > > >            {
> > > >                es_format_t fmt;
> > > > --
> > > > 2.23.0
> > > >
> > > > _______________________________________________
> > > > vlc-devel mailing list
> > > > To unsubscribe or modify your subscription options:
> > > > https://mailman.videolan.org/listinfo/vlc-devel
> > > >
> > > _______________________________________________
> > > vlc-devel mailing list
> > > To unsubscribe or modify your subscription options:
> > > https://mailman.videolan.org/listinfo/vlc-devel
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > https://mailman.videolan.org/listinfo/vlc-devel
> >
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list