From patchwork Thu Mar 12 09:00:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 449350 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9503A14012F for ; Thu, 12 Mar 2015 20:01:20 +1100 (AEDT) Received: from localhost ([::1]:58685 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVyzW-0001QO-Rc for incoming@patchwork.ozlabs.org; Thu, 12 Mar 2015 05:01:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVyyz-0000Mc-TP for qemu-devel@nongnu.org; Thu, 12 Mar 2015 05:00:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVyyv-00058K-3k for qemu-devel@nongnu.org; Thu, 12 Mar 2015 05:00:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVyyu-000582-Lr for qemu-devel@nongnu.org; Thu, 12 Mar 2015 05:00:41 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2C90W72015152 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 12 Mar 2015 05:00:32 -0400 Received: from nilsson.home.kraxel.org (ovpn-116-36.ams2.redhat.com [10.36.116.36]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2C90VBm023977; Thu, 12 Mar 2015 05:00:32 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id DD93580C26; Thu, 12 Mar 2015 10:00:29 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 12 Mar 2015 10:00:23 +0100 Message-Id: <1426150825-782-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1426150825-782-1-git-send-email-kraxel@redhat.com> References: <1426150825-782-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gonglei , Gerd Hoffmann , Anthony Liguori Subject: [Qemu-devel] [PULL 5/7] ui/console: fix OVERFLOW_BEFORE_WIDEN X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Gonglei Signed-off-by: Gonglei Signed-off-by: Gerd Hoffmann --- ui/console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/console.c b/ui/console.c index 87af6b5..b15ca87 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1285,9 +1285,9 @@ DisplaySurface *qemu_create_displaysurface_guestmem(int width, int height, linesize = width * PIXMAN_FORMAT_BPP(format) / 8; } - size = linesize * height; + size = (hwaddr)linesize * height; data = cpu_physical_memory_map(addr, &size, 0); - if (size != linesize * height) { + if (size != (hwaddr)linesize * height) { cpu_physical_memory_unmap(data, size, 0, 0); return NULL; }