From patchwork Thu Mar 2 19:06:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suhrid Subramaniam X-Patchwork-Id: 18336 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 04D1ABF415 for ; Thu, 2 Mar 2023 19:06:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 67DF46269C; Thu, 2 Mar 2023 20:06:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1677784005; bh=O6ftFmTGLwH/6SdZWXRQpbxFlpmGG7wMUd9sKa1O/gY=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Rfk8TUVXbE44J0qvd37FpqDCn6LsPSZNwFB6/dwD9OKqQKYnGAlw5lbBYopmjj4HO SuHNMAXDEJV5I+vEDkukM8kMwvTVKCgS74SF+sKwUaYPOqHN1KPvUAhiMP7IzlcX6D gJNY/ltsKLCjDe6uwdk96brdoTcaF/3yTR6zdIaApFWisABRhQG/OTV+qSpBD+GGGC R517KaYlBmNUOtwUGRGHgvbbHc2P1PgkgxsSB8GVwEE0QQmVetEFvB9a7DeBX7fXyS uTrsu6QmiYQYXcYM05L/Xd96nDBC6YKfHtYFDb5M6DLyr9qIXce8dbalSLCuWSQPXA nuBMDf/q9uD0g== Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 49D316267E for ; Thu, 2 Mar 2023 20:06:43 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RU52fJap"; dkim-atps=neutral Received: by mail-pg1-x529.google.com with SMTP id q189so70046pga.9 for ; Thu, 02 Mar 2023 11:06:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677784001; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=XVwylwi2ms9XQ374sxPxUctERFVXhy8Sh7tu6Cdawzg=; b=RU52fJappFDtIv18y2K6sjWf9/R4LaR8uSwBLbilBPFFhjW9szVoTaoE0MfZVTiEZD m5Qj2FAqgeYTEQYiAG2M11YWtcUSOAH36D2icLtD00xfHrFPH3W7iI3gWuT57h9ft8YB 05+nRVM/QyrW0a18PbpxeKo9RVaHfl0rBcyahvQ/wE5XCOKm1uyOnN+GHq9reJAbSslm /ONkScaFsmLTrRKYnLazsEovA+gqJ6t4+kcFfJ6hTI1JtzHKIFh1wha6KByLSDFGgPQx dLmkb1XNKoBEgzaNw+boaMU+/ge/aAzQuuNqe7GiFRQBLKj5i0asW619ZM5cH515DMj+ UtBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677784001; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XVwylwi2ms9XQ374sxPxUctERFVXhy8Sh7tu6Cdawzg=; b=Lcv5LBi7u7WMHhruyhI9khaOgnfnsLipuIhjpM1qG/5O9yiinW0wO48HZVa+MHRehs BcdJ+cPUN/4IEiX1Dz7wKohXOHZbVX10b9FMbdKaXEXIuoZTZ6DvM0hwX7u0JUijq9+Z kII+6BiXo1IMTN9trDntH97QLyGICUOiWot4yElqqxrnRImWlgsAVfjhe0rkfDYKXE5X KYnVY9ahgAEvpVoXDK/+LJE48s4ypACzo3+OErVMFu3iN2sq+BsKjh5KiI6qLHgx74TW /3x2I+eazi54ME+Sds3Hpl54flyOkkraQOmA+CE1La6xUPxqjRi+wkg5phzTIgD/k4Ca CEtQ== X-Gm-Message-State: AO0yUKXOFyb9aaJTCHWXY6Scdozy34sq1rwlyj/uM8y3Xb1DKVOhkVte 4K6hvvVD4W4I3unfve2KaW8XvyFHDRGrxw== X-Google-Smtp-Source: AK7set/j2Id1pMFtuE98ub6lGrC7DybehcMGxr2SU6+rEuAIZc24q1S/hepXcWWTc9sFF4ZafYV5KQ== X-Received: by 2002:a62:a518:0:b0:5e3:f20a:b670 with SMTP id v24-20020a62a518000000b005e3f20ab670mr11387442pfm.2.1677784001179; Thu, 02 Mar 2023 11:06:41 -0800 (PST) Received: from localhost.localdomain (sfosm0151r356001-v22.wiline.com. [67.207.106.98]) by smtp.gmail.com with ESMTPSA id x26-20020aa784da000000b005d92c9afbd4sm63678pfn.33.2023.03.02.11.06.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 11:06:40 -0800 (PST) X-Google-Original-From: Suhrid Subramaniam To: libcamera-devel@lists.libcamera.org Date: Thu, 2 Mar 2023 11:06:28 -0800 Message-Id: <20230302190629.12506-1-suhrid.subramaniam@mediatek.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Subject: [libcamera-devel] [libcamera-devel, v3, 0/1] libcamera: converter: Check converter validity 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: , X-Patchwork-Original-From: Suhrid Subramaniam via libcamera-devel From: Suhrid Subramaniam Reply-To: Suhrid Subramaniam Cc: Suhrid Subramaniam Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" - In cases where ConverterFactoryBase::create returns a nullptr, converter_->isValid() causes a segmentation fault. - Solve this by checking if converter_ is a nullptr. - Additionally, check for converter validity in the create function itself and return a nullptr if the converter is invalid. Suhrid Subramaniam (1): libcamera: converter: Check converter validity src/libcamera/converter.cpp | 3 ++- src/libcamera/pipeline/simple/simple.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)