mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 10:30:05 +01:00
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>
(cherry picked from commit e5c0f56ca0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -343,8 +343,7 @@ static int tonemap_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
|
|||||||
int err;
|
int err;
|
||||||
double peak = ctx->peak;
|
double peak = ctx->peak;
|
||||||
|
|
||||||
AVHWFramesContext *input_frames_ctx =
|
AVHWFramesContext *input_frames_ctx;
|
||||||
(AVHWFramesContext*)input->hw_frames_ctx->data;
|
|
||||||
|
|
||||||
av_log(ctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n",
|
av_log(ctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n",
|
||||||
av_get_pix_fmt_name(input->format),
|
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)
|
if (!input->hw_frames_ctx)
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
|
input_frames_ctx = (AVHWFramesContext*)input->hw_frames_ctx->data;
|
||||||
|
|
||||||
output = ff_get_video_buffer(outlink, outlink->w, outlink->h);
|
output = ff_get_video_buffer(outlink, outlink->w, outlink->h);
|
||||||
if (!output) {
|
if (!output) {
|
||||||
|
|||||||
Reference in New Issue
Block a user