From patchwork Sat Jul 31 05:35:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 29147 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5d:965a:0:0:0:0:0 with SMTP id d26csp135668ios; Fri, 30 Jul 2021 22:42:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEP5y47gVqvVmz93t1S8irkYTsEIfMoEKH3RmV0V0YWbTwSC92ZBHnodds+B0tZ2iwbxGF X-Received: by 2002:a17:906:2813:: with SMTP id r19mr6029677ejc.150.1627710175342; Fri, 30 Jul 2021 22:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627710175; cv=none; d=google.com; s=arc-20160816; b=vg8J669LDtoZh3J85d+RLVmF3HrbTbQQ+PY36H83lAV5LflVF0850an1cTIsFviZ5N bSqu6jeVwXlMc+jx8odqRz1agpTp/D4gpLttKyFmjVa2+k6SibHoeria9hLcEl9Tg+8k dML8m1BEbSDQNHp2K2ywfW67pV7Y3zTHSHJKGG6hrFC7IbQWqC7icHgHYMP4zVlZXk9W M5tfIWG+0GsVYf9EH5LjHau1Tb1ShZjJG66A2KzKIlwUvFQbYDU39ESwntalQ+5otGQE wp4dT5UXDZzfVMK25+a03M0qNbWTCQky3XJSAKgU8bu5xGZsCKArY19vwC41K3GcLGmd 8Wjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=N8W2OlMokVJ5dfn/FDWicEHHABQboJ118xfqHg1SyW0=; b=EP7DF/D9GqA5lrVfHPN2IvAKLrKMYxvb85vUjj8QaeBL8DWSZMjed3G2fOYZQ1EPlo Wu8j2GYbuDuKqK+kRK9wgVLcD5VW3o31j9qXSuNUyEekRl+5JYR7AjGXZAciP/K2smOm +skhL0bYIfvuPrL/FcuWEk+3VP/eY68IP1zvFpQoEFL5Mdl3vTyia/qSNWwExyw8bDxR wcEzLAk9yKvRwrP5xYNuNRWpz3T0uaHklBeN3nW1EeY9s2vzkOeXugdjq0gigqtoW/vP fg/W4YGQh4b6UAamHCJjOCeKtaBoIn31Mo6qskAgxiB9RYvUYAstkZf3HcBu3ZnTECjK uuVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=V+nssGHc; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hp8si4310000ejc.49.2021.07.30.22.42.55; Fri, 30 Jul 2021 22:42:55 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=V+nssGHc; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 83D9F68A2F6; Sat, 31 Jul 2021 08:42:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 94E0A68A0F9 for ; Sat, 31 Jul 2021 08:42:45 +0300 (EEST) Received: by mail-oi1-f170.google.com with SMTP id t14so16433712oiw.0 for ; Fri, 30 Jul 2021 22:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BpRvmxEY/uKnNpz71U+knN1cWsUaMH6abM3kZadvY6I=; b=V+nssGHcvTgIcW6Gu33P9uuv5Gp1y9rLhrYqxwNUDWxbtuHBWpj3oFNkklWHEAl1tC jb5AvcNVu8u+/wx+rbDhPxUrhMt+yo5Oj9J6vsIkGcrluWhNQamofoO/zS61TH1nwkth wRGXbLGITGorykTExQ+EpFt7fZp0Lq8OlGM9K+bwYUoTIevByDW7NlhyB930WZgwBlZi KIiE8K+HtzFvZYklOrh9G/lfFiIFf0AQsPoPcd15MorQqx2UNvVC6mw9FgaBjcgzl0w5 36fpgOPEgcZRzmBe5Y8w2ZQEKXCgyGUB3+gKOJHv3UjcLDjKHN7+ctIoCwMJKyELn56X 0Kow== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=BpRvmxEY/uKnNpz71U+knN1cWsUaMH6abM3kZadvY6I=; b=e4QPpdaqbkSyzpXhSjB0jcfUKhSD4czUxX9ro/aS7aZq0VZCGsat8AeYIbs9PhH4N+ T27h+Iqyz/b+gn5i93KVvg+J94ZneES2cIgUkNNnreIS/8zdSn7L2KemPGgiaRTBCocf BtgKsm8jd5yxPLTOfOatQXmknWHimr9DP6u8z8R5mETe5qMfrpb51X+H5UBaONjm04Vh wCZNg6uHR+J3qP1PlMZl6m5uSXeD4OZ6gFWof6TbiMbWWoVghd4UkF7V4JuJEO9NiP0S 18Z3SMbQBWRlx9jCydN9dmC8ou0kM8HN4etXvouQaX5cA1xM6a6l8zKGNAC39mtBrxU2 hxVQ== X-Gm-Message-State: AOAM531lXbU4GOurO3fFuN9oOJLbwGPjYuqcyjzl2Hsm002t18vWfuNI A8K3GEsyXMCMBlGXuwT0mR7zxAyra5uz9A== X-Received: by 2002:a17:90a:cf94:: with SMTP id i20mr6544966pju.219.1627709768774; Fri, 30 Jul 2021 22:36:08 -0700 (PDT) Received: from localhost.localdomain ([103.157.220.250]) by smtp.googlemail.com with ESMTPSA id p34sm4312266pfh.172.2021.07.30.22.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 22:36:08 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Sat, 31 Jul 2021 11:05:16 +0530 Message-Id: <20210731053516.7700-8-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210731053516.7700-1-shubhanshu.e01@gmail.com> References: <20210731053516.7700-1-shubhanshu.e01@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 8/8] lavfi/dnn_backend_tf: Error Handling for tf_create_inference_request X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Shubhanshu Saxena Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: nJs2cETYNvm6 This commit includes the check for the case when the newly created TFInferRequest is NULL. Signed-off-by: Shubhanshu Saxena --- libavfilter/dnn/dnn_backend_tf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_tf.c b/libavfilter/dnn/dnn_backend_tf.c index 9c96868fab..b14b621bee 100644 --- a/libavfilter/dnn/dnn_backend_tf.c +++ b/libavfilter/dnn/dnn_backend_tf.c @@ -134,6 +134,9 @@ static void tf_free_request(TFInferRequest *request) static TFInferRequest *tf_create_inference_request(void) { TFInferRequest *infer_request = av_malloc(sizeof(TFInferRequest)); + if (!infer_request) { + return NULL; + } infer_request->tf_outputs = NULL; infer_request->tf_input = NULL; infer_request->input_tensor = NULL;