[FFmpeg-devel] [PATCH 1/2] libwebpenc_animencoder: zero initialize the WebPAnimEncoderOptions struct

James Almer jamrial at gmail.com
Thu Mar 17 15:06:29 CET 2016


On 3/17/2016 4:32 AM, wm4 wrote:
> On Thu, 17 Mar 2016 01:03:49 -0300
> James Almer <jamrial at gmail.com> wrote:
> 
>> This zeroes the WebPAnimEncoderOptions.verbose field, silencing library info messages
>> printed to stderr.
>>
>> Signed-off-by: James Almer <jamrial at gmail.com>
>> ---
>>  libavcodec/libwebpenc_animencoder.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/libwebpenc_animencoder.c b/libavcodec/libwebpenc_animencoder.c
>> index d7437a9..35c456a 100644
>> --- a/libavcodec/libwebpenc_animencoder.c
>> +++ b/libavcodec/libwebpenc_animencoder.c
>> @@ -41,7 +41,7 @@ static av_cold int libwebp_anim_encode_init(AVCodecContext *avctx)
>>      int ret = ff_libwebp_encode_init_common(avctx);
>>      if (!ret) {
>>          LibWebPAnimContext *s = avctx->priv_data;
>> -        WebPAnimEncoderOptions enc_options;
>> +        WebPAnimEncoderOptions enc_options = { 0 };
>>          WebPAnimEncoderOptionsInit(&enc_options);
>>          // TODO(urvang): Expose some options on command-line perhaps.
>>          s->enc = WebPAnimEncoderNew(avctx->width, avctx->height, &enc_options);
> 
> Does this mean it was reading uninitialized values from the stack?

Apparently. Should i backport this?



More information about the ffmpeg-devel mailing list