[vlc-devel] [vlc-commits] commit: modules/video_filter/colorthres.c: set default values ( Jean-Paul Saman )

Rémi Denis-Courmont remi at remlab.net
Tue Sep 7 18:13:02 CEST 2010




On Tue,  7 Sep 2010 13:03:12 +0200 (CEST), git at videolan.org wrote:
> vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Sun Aug
> 29 17:19:03 2010 +0200| [d659fcdc15b517c7da63114ce3ae044a431377d5] |
> committer: Jean-Paul Saman
> 
> modules/video_filter/colorthres.c: set default values
> 
> The compiler complained about possible use uninitialized use of the
> variables i_u_offset, i_v_offset and i_y_offset.

Will you ever read the underlying code when you "fix warnings"?


> diff --git a/modules/video_filter/colorthres.c
> b/modules/video_filter/colorthres.c
> index ace2fda..c6c44e0 100644
> --- a/modules/video_filter/colorthres.c
> +++ b/modules/video_filter/colorthres.c
> @@ -287,7 +287,7 @@ static picture_t *FilterPacked( filter_t *p_filter,
> picture_t *p_pic )
>          return NULL;
>      }
> 
> -    int i_y_offset, i_u_offset, i_v_offset;
> +    int i_y_offset = 0, i_u_offset = 0, i_v_offset = 0;
>      GetPackedYuvOffsets( p_filter->fmt_in.video.i_chroma,
>                           &i_y_offset, &i_u_offset, &i_v_offset );

If you had bothered to read the code, you'd have noticed the problem is
that the return value should be checked for errors (or maybe that the
compiler is silly).

-- 
Rémi Denis-Courmont
http://www.remlab.net
http://fi.linkedin.com/in/remidenis




More information about the vlc-devel mailing list