[FFmpeg-devel] [PATCH] Fix gif decoder max option

James Almer jamrial at gmail.com
Tue Sep 17 04:29:28 EEST 2019


On 9/16/2019 10:24 PM, Soft Works wrote:
>> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
>> James Almer
>> Sent: Tuesday, September 17, 2019 3:11 AM
>> To: ffmpeg-devel at ffmpeg.org
>> Subject: Re: [FFmpeg-devel] [PATCH] Fix gif decoder max option
>>
>> On 9/16/2019 10:05 PM, Soft Works wrote:
>>> An int32 option cannot have a maximum of UINT32_MAX
>>
>> AV_OPT_TYPE_INT options are int64_t. In this case however the storage
>> type for trans_color in GifState is int.
>>
>> Reading the code i see it's intended to be uint32_t, so i think the correct fix is
>> changing its storage type, and not limiting its allowed range. Same with
>> stored_bg_color.
> 
> Hi James,
> 
> Thanks for looking into this.
> 
> The purpose of this option is to indicate a "replacement color" for transparent pixels.
> Such a replacement color itself can never have an alpha component.
> 
> I was unsure how to indicate this. Maybe, by setting the maximum to 0x00FFFFFF ?

In that case set the max to GIF_TRANSPARENT_COLOR (default value), which
is 0x00FFFFFF.

Storage type as int in the struct is still wrong IMO, but i guess it's
harmless. I'll let others chime in either way.

> 
> softworkz
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> 



More information about the ffmpeg-devel mailing list