[FFmpeg-devel] [PATCH] warning fix for libswscale/swscale-example.c
Fri Mar 20 15:36:42 CET 2009
On 03/20/2009 10:46 AM, Benoit Fouet wrote:
> On 03/19/2009 12:06 PM, Benoit Fouet wrote:
>> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 692 bytes
Desc: not available
More information about the ffmpeg-devel