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 06E9547F9E for ; Mon, 5 Feb 2024 11:45:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1415E68D158; Mon, 5 Feb 2024 13:45:12 +0200 (EET) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D960168CD88 for ; Mon, 5 Feb 2024 13:45:05 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 42993C000C for ; Mon, 5 Feb 2024 11:45:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1707133505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=hTecMOsQzzGlFaqNmoP4R2kNOnWRuFYcSX1EnWnHbe0=; b=Bhd2CuHGCcVZ+1/Y94r+3OEpzQMIJalqQgHVb1J66x4lsHXVq+1XZEbNU3MtaBo/B0dc5o Vf8ZnVpccVy2EluNgMYJFyIZi2sPmmrwAyPvCFomYZiBHKFVP3ZHPgIgDEgtm0aNA7dk9/ aJtUWYCSTvmZ+q6hQIhsVzyMxXgo2d6o6snErQtUANywFeCxR6uq6mV6mhskDCqeJHDh5h dxe38Um06/3EkRqvJRaIXz1VqE3NujB0bj70lOaqB75lyUia8uRgY6vvxh9NP0P1gaNmBL pE1btQo7iyR4WK/EQz9k7QrAkHL1K9tf/ZWvMrOgwJws9Uj0m2aVGcM47VW87g== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 5 Feb 2024 12:44:59 +0100 Message-Id: <20240205114459.8317-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240205114459.8317-1-michael@niedermayer.cc> References: <20240205114459.8317-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/2] avfilter/signature_lookup: Do not dereference NULL pointers after malloc failure 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 MIME-Version: 1.0 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: Fixes: CID 1403229 Dereference after null check Signed-off-by: Michael Niedermayer --- libavfilter/signature_lookup.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_lookup.c index 52a97e1bc7e..0c724456e24 100644 --- a/libavfilter/signature_lookup.c +++ b/libavfilter/signature_lookup.c @@ -298,6 +298,11 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont if (!c->next) av_log(ctx, AV_LOG_FATAL, "Could not allocate memory"); c = c->next; + + } + if (!c) { + sll_free(&cands); + goto error; } c->framerateratio = (i+1.0) / 30; c->score = hspace[i][j].score; @@ -314,6 +319,7 @@ static MatchingInfo* get_matching_parameters(AVFilterContext *ctx, SignatureCont } } } + error: for (i = 0; i < MAX_FRAMERATE; i++) { av_freep(&hspace[i]); } -- 2.17.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".