[vlc-devel] [PATCH] Luahttp can access equalizer settings

akash mehrotra mehrotra.akash at gmail.com
Thu Jun 23 23:43:35 CEST 2011


On Fri, Jun 24, 2011 at 3:05 AM, Laurent Aimar <fenrir at elivagar.org> wrote:

> Hi,
>
> On Fri, Jun 24, 2011 at 02:56:11AM +0530, akash mehrotra wrote:
> > Some more minor fixes.
> > I hope its correct this time.
>
> > @@ -51,6 +52,12 @@ static int vlclua_preamp_get( lua_State *L )
> >      if( p_input )
> >      {
> >          aout_instance_t *p_aout = input_GetAout( p_input );
> > +        char *psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
> > +        if ( !p_aout || strstr ( psz_af, "equalizer" ) == NULL )
>  The p_aout check seems badly placed, var_Get* should not be called on
> NULL objects.
>  var_GetNonEmptyString will return NULL for empty strings, and then
> strstr()
> will probably segfault.
>
> (Same for the following ones).
>
> Would it be OK this way?

 aout_instance_t *p_aout = input_GetAout( p_input );
        if ( !p_aout )
        {
            vlc_object_release( p_input );
            return 0;
        }
        char *psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
        if ( strstr ( psz_af, "equalizer" ) == NULL )
        {
            vlc_object_release( p_aout );
            vlc_object_release( p_input );
            return 0;
        }

> --
> fenrir
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110624/ce882a89/attachment.html>


More information about the vlc-devel mailing list