From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTWiG-00010N-Mi for qemu-devel@nongnu.org; Wed, 10 Feb 2016 10:29:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTWiC-0000iP-KL for qemu-devel@nongnu.org; Wed, 10 Feb 2016 10:29:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTWiC-0000iE-F6 for qemu-devel@nongnu.org; Wed, 10 Feb 2016 10:29:48 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 154F93824F0 for ; Wed, 10 Feb 2016 15:29:48 +0000 (UTC) References: <1455015557-15106-3-git-send-email-pbonzini@redhat.com> <56BA3948.4080301@redhat.com> <56BB2DD6.6050201@redhat.com> <56BB4F59.7090606@redhat.com> From: Paolo Bonzini Message-ID: <56BB5768.7040006@redhat.com> Date: Wed, 10 Feb 2016 16:29:44 +0100 MIME-Version: 1.0 In-Reply-To: <56BB4F59.7090606@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] cirrus_vga: fix off-by-one in blit_region_is_unsafe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: qemu-devel@nongnu.org, Gerd Hoffmann On 10/02/2016 15:55, Laszlo Ersek wrote: >> > Hmm, not sure why. We're comparing against the inclusive-exclusive >> > range [0,s->vga.vram_size). The right way to check if something is >> > within the range is >= min && < max; the right way to check if something >> > is outside the range is < min || >= max. > Absolutely: if the thing you are verifying against the interval is > itself an inclusive thing, that is, a pixel or byte *drawn*. However, > exactly as you stated in the commit message, for the maximum check, what > we are comparing is the first offset *not* processed. Right, what my patch does is setting min and max both to pixels that are drawn. Paolo