[FFmpeg-devel] [PATCH] warning fix for libswscale/swscale-example.c

Michael Niedermayer michaelni
Fri Mar 20 16:52:20 CET 2009


On Fri, Mar 20, 2009 at 03:36:42PM +0100, Benoit Fouet wrote:
> On 03/20/2009 10:46 AM, Benoit Fouet wrote:
> > On 03/19/2009 12:06 PM, Benoit Fouet wrote:
> >   
> >> Hi,
> >>
> >> On 03/19/2009 11:23 AM, Diego Biurrun wrote:
> >>   
> >>     
> >>> Here is a patch to fix or work around the following warnings:
> >>>
> >>> libswscale/swscale-example.c: In function 'main':
> >>> libswscale/swscale-example.c:60: warning: 'outContext' may be used uninitialized in this function
> >>> libswscale/swscale-example.c:60: warning: 'dstContext' may be used uninitialized in this function
> >>> libswscale/swscale-example.c:60: warning: 'srcContext' may be used uninitialized in this function
> >>>
> >>> Index: libswscale/swscale-example.c
> >>> ===================================================================
> >>> --- libswscale/swscale-example.c    (revision 28997)
> >>> +++ libswscale/swscale-example.c    (working copy)
> >>> @@ -59,6 +59,7 @@
> >>>      uint64_t ssdY, ssdU, ssdV;
> >>>      struct SwsContext *srcContext, *dstContext, *outContext;
> >>>      int res;
> >>> +    srcContext = dstContext = outContext = NULL;
> >>>
> >>>     
> >>>       
> >> this could be merged with the declarations.
> >> but this is definitely needed, indeed.
> >>
> >> BTW, even if not mentionned as a gcc warning, I think src, dst and out
> >> should be initialized too.
> >>
> >>   
> >>     
> >
> > as in the attached patch, or they could be freed while still uninitialized.
> >
> >   
> 
> updated with alpha support.

ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090320/b7a7eae1/attachment.pgp>



More information about the ffmpeg-devel mailing list