[FFmpeg-devel] [PATCH] lavf/gifdec: allow GCE of size 3.

Clément Bœsch ubitux at gmail.com
Tue May 7 17:19:14 CEST 2013


On Thu, Apr 18, 2013 at 04:18:28AM +0200, Clément Bœsch wrote:
> If there is no transparency flag, the transparent color index is not
> part of the of the block, and the size becomes 3B.
> 
> Quoting the specifications:
>     viii) Transparency Index - The Transparency Index is such that when
>     encountered, the corresponding pixel of the display device is not
>     modified and processing goes on to the next pixel. The index is
>     present if and only if the Transparency Flag is set to 1.
> ---
>  libavformat/gifdec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/gifdec.c b/libavformat/gifdec.c
> index 1122849..3ec8160 100644
> --- a/libavformat/gifdec.c
> +++ b/libavformat/gifdec.c
> @@ -139,8 +139,8 @@ static int gif_read_ext(AVFormatContext *s)
>      int ret;
>  
>      if (ext_label == GIF_GCE_EXT_LABEL) {
> -        if ((sb_size = avio_r8(pb)) < 4) {
> -            av_log(s, AV_LOG_FATAL, "Graphic Control Extension block's size less than 4.\n");
> +        if ((sb_size = avio_r8(pb)) < 3) {
> +            av_log(s, AV_LOG_FATAL, "Graphic Control Extension block's size less than 3.\n");
>              return AVERROR_INVALIDDATA;
>          }

I had a browser cache issue; it seems they don't support a 3B block but
only 4, so patch dismissed.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130507/04c2a765/attachment.asc>


More information about the ffmpeg-devel mailing list