[FFmpeg-devel] [PATCH] gifdec: change the max resolution limit to 65535x65535

Michael Niedermayer michaelni at gmx.at
Thu May 31 17:00:15 CEST 2012


On Thu, May 31, 2012 at 03:21:05PM +0200, Piotr Bandurski wrote:
> diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
> index b95d5d1..18180d1 100644
> --- a/libavcodec/gifdec.c
> +++ b/libavcodec/gifdec.c
> @@ -218,8 +218,8 @@ static int gif_read_header1(GifState *s)
>      s->transparent_color_index = -1;
>      s->screen_width = bytestream_get_le16(&s->bytestream);
>      s->screen_height = bytestream_get_le16(&s->bytestream);
> -    if(   (unsigned)s->screen_width  > 32767
> -       || (unsigned)s->screen_height > 32767){
> +    if(   (unsigned)s->screen_width  > 65535
> +       || (unsigned)s->screen_height > 65535){
>          av_log(NULL, AV_LOG_ERROR, "picture size too large\n");
>          return -1;
>      }

as these are from 16bit values read from bytestream, they cant be
larger than 65535


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120531/c469cd72/attachment.asc>


More information about the ffmpeg-devel mailing list