From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id C02E747C4F for ; Thu, 14 Dec 2023 02:49:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CB74768D19A; Thu, 14 Dec 2023 04:49:41 +0200 (EET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4A99F68D010 for ; Thu, 14 Dec 2023 04:49:34 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702522180; x=1734058180; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=Jvjft9lc4fIzgoKnoXc/lmemjd695CwQ6tXO/08cLkU=; b=GOqXhYjAdgLkL9HpBJVpu+k9CgD3lfUYSuMKzyzT+uhiJy729C6Bd5UV oU8URGmF+ELAVK7eiS9B5As76kve+gFxvCs456lFJiBqsB9jy/pIMo/Jp W3mg0wCfBzHEOiWJVoG1IILVQBiwU7VD3zwESioG5/drZbojY+SJtiWu5 CPevYy3A6N4hfXyLPOsHHs9bufRKwdvGF49/onFI5Ju1g975bA9MGAjiq xBflEQPgX7t0UIU+qy0XivCMlHmkhlNg8OmitYwdS2CJUYLmls1kKBMEI 1rZaG2z+MUietPoV+iRwwuyLOkGW23srfQx5gnbfA/uzX7FM8MM1LUB5e w==; X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="16610002" X-IronPort-AV: E=Sophos;i="6.04,274,1695711600"; d="scan'208";a="16610002" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 18:49:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="947403472" X-IronPort-AV: E=Sophos;i="6.04,274,1695711600"; d="scan'208";a="947403472" Received: from wenbin-z390-aorus-ultra.sh.intel.com ([10.239.156.43]) by orsmga005.jf.intel.com with ESMTP; 13 Dec 2023 18:49:29 -0800 From: wenbin.chen-at-intel.com@ffmpeg.org To: ffmpeg-devel@ffmpeg.org Date: Thu, 14 Dec 2023 10:49:26 +0800 Message-Id: <20231214024928.230112-2-wenbin.chen@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231214024928.230112-1-wenbin.chen@intel.com> References: <20231214024928.230112-1-wenbin.chen@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/4] libavfilter/vf_dnn_detect: Add NULL pointer check 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Wenbin Chen Signed-off-by: Wenbin Chen --- libavfilter/vf_dnn_detect.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavfilter/vf_dnn_detect.c b/libavfilter/vf_dnn_detect.c index b82916ce6d..b2e9b8d4c6 100644 --- a/libavfilter/vf_dnn_detect.c +++ b/libavfilter/vf_dnn_detect.c @@ -112,6 +112,10 @@ static int dnn_detect_parse_anchors(char *anchors_str, float **anchors) } for (int i = 0; i < nb_anchor; i++) { token = av_strtok(anchors_str, "&", &saveptr); + if (!token) { + av_freep(&anchors_buf); + return 0; + } anchors_buf[i] = strtof(token, NULL); anchors_str = NULL; } -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".