[vlc-devel] [PATCH] opus: avoid NULL pointer dereference

Tristan Matthews le.businessman at gmail.com
Wed Dec 4 15:19:01 CET 2013


On Wed, Dec 4, 2013 at 7:23 AM, Rafaël Carré <funman at videolan.org> wrote:
> Hi,
>
> Le 04/12/2013 01:27, Tristan Matthews a écrit :
>> ---
>>  modules/codec/opus.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/modules/codec/opus.c b/modules/codec/opus.c
>> index de6e3d0..b739fc5 100644
>> --- a/modules/codec/opus.c
>> +++ b/modules/codec/opus.c
>> @@ -360,6 +360,7 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
>>
>>      *pp_block = NULL; /* To avoid being fed the same packet again */
>>
>> +    if( p_block )
>
> if (!p_block)
>     return NULL;
>
> ?
>
>>      {
>
> I think the block is not needed also

Yeah that's better.

Best,
T

>
>>          block_t *p_aout_buffer = DecodePacket( p_dec, p_oggpacket,
>>                                                 p_block->i_nb_samples,
>> @@ -368,6 +369,10 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
>>          block_Release( p_block );
>>          return p_aout_buffer;
>>      }
>> +    else
>> +    {
>> +        return NULL;
>> +    }
>>  }
>>
>>  /*****************************************************************************
>>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



-- 
Tristan Matthews
web: http://tristanswork.blogspot.com



More information about the vlc-devel mailing list