From patchwork Sat Oct 23 10:32:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 14288 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 D240BBDB1C for ; Sat, 23 Oct 2021 10:33:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 02ED864873; Sat, 23 Oct 2021 12:33:16 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="XoUvQbhJ"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DF60260239 for ; Sat, 23 Oct 2021 12:33:13 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.213]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E3F5B547; Sat, 23 Oct 2021 12:33:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1634985193; bh=l/NM6MLuXFNLgFropUfBbVQLha4gxOv5E4sKnwI20g8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XoUvQbhJCzS+zQ16hV/kX2UoxLkhQ7Y7ZkdsyEMqYvpNbyiMFUtNrwQjuXNaAwkWR qmXdYivYE1lOwCanWLCubpRbi+Jz0G8FQow9wkTXTAoidFnxjsyU9LNN25EODiOhOV jmLdofkogMCGS6Vdx1RtHVcB+6AoNn/dLYS5RFVw= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Sat, 23 Oct 2021 16:02:57 +0530 Message-Id: <20211023103302.152769-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211023103302.152769-1-umang.jain@ideasonboard.com> References: <20211023103302.152769-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 2/7] android: post_processor_jpeg: Replace encoder_ nullptr check 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" Instead of simply returning if encoder_ is nullptr, fail hard via an assertion. It is quite unlikely that encoder_ will be nullptr in PostProcessorJpeg::process() so, be loud about the failure. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Hirokazu Honda Reviewed-by: Kieran Bingham --- src/android/jpeg/post_processor_jpeg.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp index 699576ef..49483836 100644 --- a/src/android/jpeg/post_processor_jpeg.cpp +++ b/src/android/jpeg/post_processor_jpeg.cpp @@ -102,9 +102,7 @@ int PostProcessorJpeg::process(const FrameBuffer &source, CameraBuffer *destination, Camera3RequestDescriptor *request) { - if (!encoder_) - return 0; - + ASSERT(encoder_); ASSERT(destination->numPlanes() == 1); const CameraMetadata &requestMetadata = request->settings_;