From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9q07-000243-2m for qemu-devel@nongnu.org; Mon, 06 Jun 2016 04:35:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9q02-0000Wy-42 for qemu-devel@nongnu.org; Mon, 06 Jun 2016 04:35:10 -0400 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:37940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9q01-0000WW-T2 for qemu-devel@nongnu.org; Mon, 06 Jun 2016 04:35:06 -0400 Received: by mail-wm0-x235.google.com with SMTP id m124so61663151wme.1 for ; Mon, 06 Jun 2016 01:35:05 -0700 (PDT) Sender: Paolo Bonzini References: <1464937468-14816-1-git-send-email-kraxel@redhat.com> <1464937468-14816-6-git-send-email-kraxel@redhat.com> From: Paolo Bonzini Message-ID: <226ed83e-c5fd-8092-84a8-87f3ee46f6b6@redhat.com> Date: Mon, 6 Jun 2016 10:35:00 +0200 MIME-Version: 1.0 In-Reply-To: <1464937468-14816-6-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 5/7] vnc: Add support for color map List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann , qemu-devel@nongnu.org Cc: "Denis V. Lunev" , Alexander Graf , Pavel Butsykin On 03/06/2016 09:04, Gerd Hoffmann wrote: > static void set_pixel_format(VncState *vs, > int bits_per_pixel, int depth, > int big_endian_flag, int true_color_flag, > @@ -2101,8 +2119,15 @@ static void set_pixel_format(VncState *vs, > int red_shift, int green_shift, int blue_shift) > { > if (!true_color_flag) { > - vnc_client_error(vs); > - return; > + /* Expose a reasonable default 256 color map */ > + bits_per_pixel = 8; > + depth = 8; > + red_max = 7; > + green_max = 7; > + blue_max = 3; > + red_shift = 0; > + green_shift = 3; > + blue_shift = 6; > } Coverity now notes that the "depth" argument is unused. It's not introduced by this patch, but now it notices because this hunk introduces a dead write. Thanks, Paolo