From patchwork Thu Aug 9 11:46:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liran Alon X-Patchwork-Id: 10561309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D99F514E2 for ; Thu, 9 Aug 2018 12:04:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C68E02AF52 for ; Thu, 9 Aug 2018 12:04:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA0B62AF5C; Thu, 9 Aug 2018 12:04:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B54AA2AF52 for ; Thu, 9 Aug 2018 12:04:26 +0000 (UTC) Received: from localhost ([::1]:50102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnjg1-0002i0-VC for patchwork-qemu-devel@patchwork.kernel.org; Thu, 09 Aug 2018 08:04:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fnjQY-0005g9-Cr for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:48:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fnjQV-0007ir-Qc for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:48:26 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:48720) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fnjQV-0007iU-Fx for qemu-devel@nongnu.org; Thu, 09 Aug 2018 07:48:23 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w79BiHil162731; Thu, 9 Aug 2018 11:48:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=jcZZj7jw4brC12dShNzWnByMBttGkI0MMqAh6QOXw5o=; b=VDyOmx1scG9/joxvm1ZN8hVt+ZC/cGGUIla7DU6shtPOVx/KmTp8365n1qG+3TEn36yY BJ1YUGbh80lqJgx5fnkVT7u0B2l7SJhYse7nCpd9WihVF9NMifuiEOO5Cy2tPT+R7JAc 0tk9V0DFitb1dFOce9t75ZYYH2Kym9dUhK3ekO0taFPsfaSICmkyy7yD0xq6XP0RMCHL 5kWbU8nNSjix2IIeOafj+0IxJ97q9JGw1h1tb1XSyX7BSfAFMUalEWiHV8LEtPtwXS1Z WNkLh+fi5RAgrF+EeV7C4SwqzLtph45QaYaXCUMtqDY7KwXT7uVfKK3VQnF5OVKLmSAT Iw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2kn1nday2f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 09 Aug 2018 11:48:22 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w79BmLZe008531 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Aug 2018 11:48:21 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w79BmLBn031526; Thu, 9 Aug 2018 11:48:21 GMT Received: from liran-pc.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 09 Aug 2018 04:48:20 -0700 From: Liran Alon To: qemu-devel@nongnu.org Date: Thu, 9 Aug 2018 14:46:42 +0300 Message-Id: <1533815202-11967-30-git-send-email-liran.alon@oracle.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1533815202-11967-1-git-send-email-liran.alon@oracle.com> References: <1533815202-11967-1-git-send-email-liran.alon@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8979 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=704 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808090123 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.79 Subject: [Qemu-devel] [PATCH 29/29] vmsvga: Don't allow setting screen size with zero width or height X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: habkost@redhat.com, mtosatti@redhat.com, Liran Alon , kraxel@redhat.com, pbonzini@redhat.com, rth@twiddle.net, Leonid Shatz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Leonid Shatz Signed-off-by: Leonid Shatz Reviewed-by: Darren Kenny Signed-off-by: Liran Alon --- hw/display/vmware_vga.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 389248b4badf..1803a565fa07 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -1566,6 +1566,9 @@ static inline void vmsvga_check_size(struct vmsvga_state_s *s) DisplaySurface *surface = qemu_console_surface(s->vga.con); uint32_t new_stride; + /* Don't allow setting uninitialized 0-size screen */ + if ((s->new_width == 0) || (s->new_height == 0)) return; + new_stride = (s->use_pitchlock >= 0) ? s->pitchlock : ((s->new_depth * s->new_width) / 8);