Skip to content

Commit

Permalink
avfilter/vf_tonemap_opencl: Dereference after NULL check
Browse files Browse the repository at this point in the history
Fixes: CID1437472 Dereference before null check

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
  • Loading branch information
michaelni committed Aug 11, 2024
1 parent 22ee55a commit e5c0f56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libavfilter/vf_tonemap_opencl.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,15 @@ 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),
input->width, input->height, input->pts);

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) {
Expand Down

0 comments on commit e5c0f56

Please sign in to comment.