[FFmpeg-devel] [PATCH] warning fix for libswscale/swscale-example.c
Benoit Fouet
benoit.fouet
Fri Mar 20 17:30:02 CET 2009
On 03/20/2009 04:52 PM, Michael Niedermayer wrote:
> 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
>
>
applied
Ben
More information about the ffmpeg-devel
mailing list