From patchwork Wed Jun 16 08:59:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12607 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E9527BD78E for ; Wed, 16 Jun 2021 08:59:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 38CC368943; Wed, 16 Jun 2021 10:59:32 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ZAFM9vvB"; dkim-atps=neutral Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 77E5A6892E for ; Wed, 16 Jun 2021 10:59:30 +0200 (CEST) Received: by mail-pj1-x1031.google.com with SMTP id g24so1315152pji.4 for ; Wed, 16 Jun 2021 01:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qRXDNQnCHnORHrJufRa3CDb5zGF1h6KYEFlPwWqG8tg=; b=ZAFM9vvBVC4/IzH4ffLzNi1gHrU188KORY2Z7i/QALHekorlhTzHs8u193p53P8oL6 oXQ1pTLjk4iOFF8i0r+rrM5FqpmmkeJtob4dqHE9KhFvAKNwxpvdIR98cfsjtuE5suvy nzqxZ2aO45PlzLJxey1jFJpKuu8ESm+xWSkCM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qRXDNQnCHnORHrJufRa3CDb5zGF1h6KYEFlPwWqG8tg=; b=Jc/k98QJPtxH+SK2vUAxlexNBkfHAP/DR/VuKBk5SU3gcRtXuPtWhoYBhGvyixVugR aG66Nahf7B1KPhYem+VtH+S1IWhi1xyeCZtGftrMZBVwqK/oeEbmusSoI9U8K0pvs+P3 OiCl/fP7cAYxhVSYammGtVvOcl4QJ7X43UQUiE2hnXmiqQ7jEDiqHvynq30GtfhGwDbY 2rDzVB0SbgFw7WyZQjOqVGytObs7cj4kMO+RZBMUjDTfcgYodO5eZjaoOyVE9XfMSfmJ ya7naWUPcDC6mlDcR+BjhDxJPIJZ6NNIVC4BTIRJt8tr1z7AU+ZIc5egbR7GykWKcdiS zP9A== X-Gm-Message-State: AOAM530Va3MDGQzUfrsT71bTJhDfGC0h1nqILFYYwj0b2BXm7kswgUHC oo2pcY5PrBMdS0FsS9LcKeYz5f/Sv9P3rw== X-Google-Smtp-Source: ABdhPJxlTSKCJvOZZU6iC0ATkObj66r9YqGitnvQu39OTWq0N72V5lZQu7XSDNostsnbwz4rdISUCg== X-Received: by 2002:a17:90a:9411:: with SMTP id r17mr3908801pjo.49.1623833968553; Wed, 16 Jun 2021 01:59:28 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:9a9a:c503:6402:b9b1]) by smtp.gmail.com with ESMTPSA id 76sm1500186pfy.82.2021.06.16.01.59.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 01:59:28 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 16 Jun 2021 17:59:23 +0900 Message-Id: <20210616085923.2888083-1-hiroh@chromium.org> X-Mailer: git-send-email 2.32.0.272.g935e593368-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] android: mm: cros_camera_buffer: Fix wrong indexing in plane() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" CameraBuffer::plane() should be accessed in zero based index. Fix the wrong indexing in CameraBuffer::plane() in cros_camera_buffer.cpp. Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart Reviewed-by: Paul Elder --- src/android/mm/cros_camera_buffer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp index 59e26d1b..c4157606 100644 --- a/src/android/mm/cros_camera_buffer.cpp +++ b/src/android/mm/cros_camera_buffer.cpp @@ -113,13 +113,13 @@ Span CameraBuffer::Private::plane(unsigned int plane) break; default: switch (plane) { - case 1: + case 0: addr = mem.ycbcr.y; break; - case 2: + case 1: addr = mem.ycbcr.cb; break; - case 3: + case 2: addr = mem.ycbcr.cr; break; }