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

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


Fixed the p_aout check

On Fri, Jun 24, 2011 at 3:13 AM, akash mehrotra <mehrotra.akash at gmail.com>wrote:

>
>
> 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/548ebd28/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-luahttp-can-access-and-set-equalizer.patch
Type: application/octet-stream
Size: 7491 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110624/548ebd28/attachment.obj>


More information about the vlc-devel mailing list