From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: image size limit? Date: Fri, 14 Oct 2005 09:02:54 -0400 Message-ID: <87fyr4w8sh.fsf@stupidchicken.com> References: <87oe5v7q19.fsf@stupidchicken.com> <87k6giiqh3.fsf@pacem.orebokech.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1129296652 4473 80.91.229.2 (14 Oct 2005 13:30:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 14 Oct 2005 13:30:52 +0000 (UTC) Cc: Romain Francoise , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 14 15:30:50 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EQPdr-0008LV-E9 for ged-emacs-devel@m.gmane.org; Fri, 14 Oct 2005 15:30:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EQPYL-0005aC-La for ged-emacs-devel@m.gmane.org; Fri, 14 Oct 2005 09:24:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EQPD9-0004Ar-IM for emacs-devel@gnu.org; Fri, 14 Oct 2005 09:02:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EQPD6-0004AA-Fz for emacs-devel@gnu.org; Fri, 14 Oct 2005 09:02:58 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EQPD6-0004A5-9Z for emacs-devel@gnu.org; Fri, 14 Oct 2005 09:02:56 -0400 Original-Received: from [18.95.6.216] (helo=localhost.localdomain) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EQPD4-0002b0-NX; Fri, 14 Oct 2005 09:02:54 -0400 Original-Received: by localhost.localdomain (Postfix, from userid 1000) id 95D421E42CC; Fri, 14 Oct 2005 09:02:54 -0400 (EDT) Original-To: rms@gnu.org In-Reply-To: (Richard M. Stallman's message of "Thu, 13 Oct 2005 16:13:31 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:44030 Archived-At: > If we handle them one by one, it won't be terribly tricky. > We could have one limit for memory size of an image, and another limit > for the width and height as a ratio to those of the window. > Then for each image type it would use whichever of those can be used. Here's another idea. We impose a limit on the size of the image file that Emacs is willing to read, say 50 megabytes. This should be easy to implement and independent of image type. 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. That should catch most of the problematic images, and we don't have to fiddle with the individual image libraries.