aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-07-10 23:47:46 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-08-11 13:21:13 +0200
commite5c0f56ca09b4cb4ea87a61547218f9c818b52d7 (patch)
treebf1367c0b5c4d91c1a338476c3ab97f8eec84641
parent22ee55a1da8218fb00c536723d488b7ca9344bd3 (diff)
downloadffmpeg-e5c0f56ca09b4cb4ea87a61547218f9c818b52d7.tar.gz
avfilter/vf_tonemap_opencl: Dereference after NULL check
Fixes: CID1437472 Dereference before null check Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/vf_tonemap_opencl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_tonemap_opencl.c b/libavfilter/vf_tonemap_opencl.c
index a2a27307b4..03219857d4 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) {