[vlc-devel] [PATCH 2/3] [mux/ogg] Fix calculation with uninitialized value

David Flynn davidf+nntp at woaf.net
Tue Nov 4 18:45:26 CET 2008


On 2008-11-04, Laurent Aimar <fenrir at via.ecp.fr> wrote:
> On Tue, Nov 04, 2008, davidf+nntp at woaf.net wrote:
>> diff --git a/modules/mux/ogg.c b/modules/mux/ogg.c
>> index e9dd721..d750426 100644
>> --- a/modules/mux/ogg.c
>> +++ b/modules/mux/ogg.c
>> @@ -320,7 +320,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
>>  
>>      msg_Dbg( p_mux, "adding input" );
>>  
>> -    p_input->p_sys = p_stream = malloc( sizeof( ogg_stream_t ) );
>> +    p_input->p_sys = p_stream = calloc( 1, sizeof( ogg_stream_t ) );
>>      if( !p_stream )
>>          return VLC_ENOMEM;
>  Which paramater is uninitialied otherwise ? And is 0 the right default
> value for it ?

I think it was b_progressive and the other interlaced fields.

As for right value? well, 0 is the least wrong (you can have PSF), but
accidently treating interlaced as progressive isn't a good move, as for
top_field_first, well we in europe set it =1, and it is also so for HD.

I've posted another patch that uses picture_New, is that any more
acceptable?

..david




More information about the vlc-devel mailing list