Received: from [140.186.70.92] (port=53434 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZ2GR-0004Yu-Tt for qemu-devel@nongnu.org; Sat, 01 Jan 2011 09:17:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZ2GQ-0000bA-OL for qemu-devel@nongnu.org; Sat, 01 Jan 2011 09:16:59 -0500 Received: from hall.aurel32.net ([88.191.126.93]:58491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZ2GQ-0000b0-Hy for qemu-devel@nongnu.org; Sat, 01 Jan 2011 09:16:58 -0500 Received: from aurel32 by hall.aurel32.net with local (Exim 4.69) (envelope-from ) id 1PZ2GP-0004nM-Hj for qemu-devel@nongnu.org; Sat, 01 Jan 2011 15:16:57 +0100 Date: Sat, 1 Jan 2011 15:16:57 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] cirrus_vga: fix division by 0 for color expansion rop Message-ID: <20110101141657.GM3615@hall.aurel32.net> References: <1293822678-4100-1-git-send-email-aurelien@aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1293822678-4100-1-git-send-email-aurelien@aurel32.net> Sender: Aurelien Jarno List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Fri, Dec 31, 2010 at 08:11:18PM +0100, Aurelien Jarno wrote: > Commit d85d0d3883f5a567fa2969a0396e42e0a662b3fa introduces a regression > with Windows ME that leads to a division by 0 and a crash. > > It uses the color expansion rop with the source pitch set to 0. This is > something allowed, as the manual explicitely says "When the source of > color-expand data is display memory, the source pitch is ignored.". > > This patch fixes this regression by computing sx, sy and others > variables only if they are going to be used later, that is for a plain > copy ROP. It basically consists in moving code. > > Signed-off-by: Aurelien Jarno > --- > hw/cirrus_vga.c | 65 ++++++++++++++++++++++++++++--------------------------- > 1 files changed, 33 insertions(+), 32 deletions(-) I have just discovered that this patch fixes bug #604166: https://bugs.launchpad.net/qemu/+bug/604166 -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net