[vlc-devel] [PATCH] Fixed warnings on missed struct fields initializers

Rémi Denis-Courmont remi at remlab.net
Mon Dec 2 13:13:19 CET 2013


On Mon,  2 Dec 2013 15:55:12 +0400, Maxim Bublis <b at codemonkey.ru> wrote:
> ---
>  modules/codec/avcodec/encoder.c | 2 +-
>  src/misc/fourcc.c               | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/modules/codec/avcodec/encoder.c
> b/modules/codec/avcodec/encoder.c
> index bae4d3f..2c7d624 100644
> --- a/modules/codec/avcodec/encoder.c
> +++ b/modules/codec/avcodec/encoder.c
> @@ -1135,7 +1135,7 @@ static block_t *encode_audio_buffer( encoder_t
> *p_enc, encoder_sys_t *p_sys,  AV
>  {
>      int got_packet, i_out;
>      got_packet=i_out=0;
> -    AVPacket packet = {0};
> +    AVPacket packet;

This is clearly wrong. I am not sure what François was trying to express,
but with your patch, packet is uninitialized, which is clearly wrong.

In other words, please test your patches.

>      block_t *p_block = block_Alloc( p_sys->i_buffer_out );
>      av_init_packet( &packet );
>      packet.data = p_block->p_buffer;
> diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
> index 8cd821a..1c9bca3 100644
> --- a/src/misc/fourcc.c
> +++ b/src/misc/fourcc.c
> @@ -2004,7 +2004,7 @@ static const struct
>          VLC_CODEC_VDPAU_VIDEO_444,
>          VLC_CODEC_VDPAU_OUTPUT, 0 },           FAKE_FMT() },
>  
> -    { {0}, { 0, { 0 }, 0, 0 } }
> +    { {0}, { 0, { { {0, 0}, {0, 0} } }, 0, 0 } }
>  };
>  
>  #undef PACKED_FMT

-- 
Rémi Denis-Courmont
Sent from my collocated server



More information about the vlc-devel mailing list