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 6C5E84B64D for ; Wed, 10 Jul 2024 22:50:36 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DAB9968DB50; Thu, 11 Jul 2024 01:50:23 +0300 (EEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8231E68DA82 for ; Thu, 11 Jul 2024 01:50:15 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id B65C81C0004 for ; Wed, 10 Jul 2024 22:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720651814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zNzzzpCkKg7XMZ7jAH/lpvY4MqJPeJgcws3/DEfazuw=; b=gTKQQ41CRuRqHOkdqhlAMCsU+nr9h9EveeZFii3usfIfMXyew9hfqxP20XK1cU1zP7CcIl 5wQSbcP3Pc7w53Oh8ptoLZs9s7+3m0tATgo5CBdOcD4XGzLH/mq+vXo57OxaPTRHy175Oi y1JEYd1CumD86eeHlS//ByjLPiBTvgJdS4KadC66pgipZHZcqsk5CQZmrNc4bgze2pjhHI 7xN6Ld3NUfv6KR0MLJ/1qW2NfuHSBT7ZITuaxeM285Z4nzt0FEWPFYpUTAtPVMhpt2t4t0 Wr/+knbJnDkYmphlQ9Aj3agb4iF0eHOK45WO/6/Uk7MiMWKkHMbvEgJI/JAevg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 11 Jul 2024 00:50:08 +0200 Message-ID: <20240710225012.691594-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240710225012.691594-1-michael@niedermayer.cc> References: <20240710225012.691594-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/6] avfilter/vf_tonemap_opencl: Dereference after NULL 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: Fixes: CID1437472 Dereference before null check Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavfilter/vf_tonemap_opencl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_tonemap_opencl.c b/libavfilter/vf_tonemap_opencl.c index a2a27307b48..03219857d46 100644 --- a/libavfilter/vf_tonemap_opencl.c +++ b/libavfilter/vf_tonemap_opencl.c @@ -343,8 +343,7 @@ static int tonemap_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input) int err; double peak = ctx->peak; - AVHWFramesContext *input_frames_ctx = - (AVHWFramesContext*)input->hw_frames_ctx->data; + AVHWFramesContext *input_frames_ctx; av_log(ctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n", av_get_pix_fmt_name(input->format), @@ -352,6 +351,7 @@ static int tonemap_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input) if (!input->hw_frames_ctx) return AVERROR(EINVAL); + input_frames_ctx = (AVHWFramesContext*)input->hw_frames_ctx->data; output = ff_get_video_buffer(outlink, outlink->w, outlink->h); if (!output) { -- 2.45.2 _______________________________________________ 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".