Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 60C1618AC0 for ; Tue, 11 Aug 2015 17:44:17 +0000 (UTC) Received: (qmail 80366 invoked by uid 500); 11 Aug 2015 17:44:16 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 80310 invoked by uid 500); 11 Aug 2015 17:44:16 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 80299 invoked by uid 99); 11 Aug 2015 17:44:16 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Aug 2015 17:44:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 510DEE024E; Tue, 11 Aug 2015 17:44:16 +0000 (UTC) From: mike-tutkowski To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request: Cloudstack 8656: do away with more silent... Content-Type: text/plain Message-Id: <20150811174416.510DEE024E@git1-us-west.apache.org> Date: Tue, 11 Aug 2015 17:44:16 +0000 (UTC) Github user mike-tutkowski commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/654#discussion_r36774764 --- Diff: services/console-proxy/server/src/com/cloud/consoleproxy/vnc/packet/server/RawRect.java --- @@ -50,26 +52,27 @@ public void paint(BufferedImage image, Graphics2D graphics) { switch (dataBuf.getDataType()) { - case DataBuffer.TYPE_INT: { - // We chose RGB888 model, so Raster will use DataBufferInt type - DataBufferInt dataBuffer = (DataBufferInt)dataBuf; + case DataBuffer.TYPE_INT: { + // We chose RGB888 model, so Raster will use DataBufferInt type + DataBufferInt dataBuffer = (DataBufferInt)dataBuf; - int imageWidth = image.getWidth(); - int imageHeight = image.getHeight(); + int imageWidth = image.getWidth(); + int imageHeight = image.getHeight(); - // Paint rectangle directly on buffer, line by line - int[] imageBuffer = dataBuffer.getData(); - for (int srcLine = 0, dstLine = y; srcLine < height && dstLine < imageHeight; srcLine++, dstLine++) { - try { - System.arraycopy(buf, srcLine * width, imageBuffer, x + dstLine * imageWidth, width); - } catch (IndexOutOfBoundsException e) { - } + // Paint rectangle directly on buffer, line by line + int[] imageBuffer = dataBuffer.getData(); + for (int srcLine = 0, dstLine = y; srcLine < height && dstLine < imageHeight; srcLine++, dstLine++) { + try { + System.arraycopy(buf, srcLine * width, imageBuffer, x + dstLine * imageWidth, width); + } catch (IndexOutOfBoundsException e) { + s_logger.info("[ignored] buffer overflow!?!", e); } - break; } + break; --- End diff -- I guess it's OK. It looks like it would fix a bug (the for loop would only execute at most once before). If you're OK with it, I'm OK with it. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---