[FFmpeg-devel] [PATCH] [RFC] fix 'may be used uninitialized' warnings

Diego Biurrun diego
Mon Feb 2 12:43:12 CET 2009


On Mon, Feb 02, 2009 at 10:54:15AM +0000, M?ns Rullg?rd wrote:
> Diego Biurrun <diego at biurrun.de> writes:
> 
> > Here is a patch to fix all but one 'may be used initialized' warning
> > in FFmpeg.  Regression tests pass, so this cannot have broken things
> > too badly, but some of it may nonetheless be suspicious.
> >
> > Please review, I will commit individual hunks as they get approved,
> > not before.
> >
> > --- libavcodec/motion_est.c	(revision 16938)
> > +++ libavcodec/motion_est.c	(working copy)
> > @@ -536,7 +536,7 @@
> >      int block;
> > -    int P[10][2];
> > +    int P[10][2] = {0, 0};
> >      int dmin_sum=0, mx4_sum=0, my4_sum=0;
> > @@ -686,7 +686,7 @@
> >      int block;
> > -    int P[10][2];
> > +    int P[10][2] = {0, 0};
> >      uint8_t * const mv_penalty= c->current_mv_penalty;
> 
> Those initialisers are incorrect, lacking a set of braces.  The
> correct syntax would be {{0}, {0}}.  The simpler {} is also correct.
> GCC should issue a warning about this, something like "missing braces
> in initialiser".

It does indeed, changed locally.

Diego




More information about the ffmpeg-devel mailing list