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

Benoit Fouet benoit.fouet
Thu Mar 19 12:06:14 CET 2009


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.

Ben





More information about the ffmpeg-devel mailing list