emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: image size limit?


From: Chong Yidong
Subject: Re: image size limit?
Date: Sat, 15 Oct 2005 14:33:57 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>     At the same time, we implement image width and height limits in
>     x_create_x_image_and_pixmap, to deal with malicious images that
>     specify gigantic width and height sizes, even though the file size
>     isn't that big.
>
> Will that succeed in handling the problem case we got?

It will avoid allocating too much memory in Emacs.  Whether libungif
tries to allocate too much memory prior to this, depends on the
internal implementation of libungif.  Worst that could happen is that
libungif believes the invalid width and height data, tries to malloc a
big chunk of memory, malloc fails, and DGifSlurp() frees the memory
and returns with an error, which we catch.

I can't find any libungif function for controlling how much memory
libungif uses.

As for libpng, the png_set_user_limits() function was only added in
version 1.0.16rc1, from 2004, so if we use that we'll lose
compatibility with older versions.

I don't think it's worth delaying the release for this.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]