From patchwork Thu Oct 22 08:17:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 10196 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 35007C3D3C for ; Thu, 22 Oct 2020 08:17:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 02EF961451; Thu, 22 Oct 2020 10:17:55 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ksB+2PMK"; dkim-atps=neutral Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2CC4760530 for ; Thu, 22 Oct 2020 10:17:51 +0200 (CEST) Received: by mail-lj1-x22b.google.com with SMTP id x16so992792ljh.2 for ; Thu, 22 Oct 2020 01:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jqnB/BtIX3D+kr8HI42UutvPxNkoC0nsGGkFaAmI3UA=; b=ksB+2PMKUkEjBJG2W0qs3LEb+46ybxio2KjnS2AViaBDJPSuEuRYaKYFrzV5QgPaZv qtaupfLb1IBDvqQYx3RHBdiPpAaaZg30jSwuAc4mD/O/MfxDd7ZJhNdNUkyRBrHiUfdt EX9EhCMsciiUcQr5IiUL2zcmGmfbdg4r50VbM+evaRXMQT/lpEa0CriDw463Ppf1wpyD lH+UiTWypgO7mBB6tED1lzEvV2pGtXD9jxje8A/wB0eGhKmZK1Un2NvyqSs6H1Ah0sUA eglbuJK8tZKLDko28VIfxHSehrtjJgOnEhFIp71CGfHCb7rw7+fqCxZPa6cGueBfnQVe odkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jqnB/BtIX3D+kr8HI42UutvPxNkoC0nsGGkFaAmI3UA=; b=a276j/GnnHS2T3M+7DfN8rMB/dbCsGV0ktJtJeBOTzaCJSZdQe6IAUEGhG6tHvNACs pqKj1HbAaqFj81C5De/3seDratp4WXeoigew4RMEkMuAQ2OvOyjvbSfPzYksCVKPrS/+ aYZ2cEiTKHTtUKoC8aaV7l6p/D2ciY2Go09bIiiYzFiqzm0n+oPsxQwp1DGLu5ihYuWS 0pplAuiJLoW2JO8cFL0Qal2H/NYaCPvvxmA8Fl1QIpvY/0CSVlqON2l+pZekYpvNGDvx G3NthuquK6pyCR8OqTw9wyMiUVXb44Z+5buuXk3G0gfIq+lCXVTGhefmtJqOkNFb3R2d 9zgA== X-Gm-Message-State: AOAM532MmSD3P2AkcuCGOzw/Gdym9lUudcyZExPf8hU9xlGzUFHoFjxK 1U4zM33lUQkyOPKNUk0n9CR8x2nLqWQDfQ== X-Google-Smtp-Source: ABdhPJydL2crB5lJ2RVItKDoTae90TtBB4F4mJWxXI/VxijH9duZhD8bkjuBOj0DqIGANrvFXrip5w== X-Received: by 2002:a2e:9689:: with SMTP id q9mr505355lji.434.1603354670503; Thu, 22 Oct 2020 01:17:50 -0700 (PDT) Received: from deskari.lan (91-152-83-50.elisa-laajakaista.fi. [91.152.83.50]) by smtp.gmail.com with ESMTPSA id l3sm187007lji.36.2020.10.22.01.17.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 01:17:50 -0700 (PDT) From: Tomi Valkeinen To: libcamera-devel@lists.libcamera.org Date: Thu, 22 Oct 2020 11:17:30 +0300 Message-Id: <20201022081731.36217-3-tomi.valkeinen@iki.fi> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201022081731.36217-1-tomi.valkeinen@iki.fi> References: <20201022081731.36217-1-tomi.valkeinen@iki.fi> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/4] libcamera: pipeline: simple: return from match() on error 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: , Cc: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" If converter_->open() fails, the code deletes the converter_ but then happily goes on, and at the very next lines will use converter_. I assume the intention is to return from the function with false. Signed-off-by: Tomi Valkeinen --- src/libcamera/pipeline/simple/simple.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 0d48e1b6..df93bc8d 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -774,6 +774,7 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator) << "Failed to open converter, disabling format conversion"; delete converter_; converter_ = nullptr; + return false; } converter_->bufferReady.connect(this, &SimplePipelineHandler::converterDone);