Fixes: CID1437472 Dereference before null check
Unified · Split
| @@ -343,8 +343,7 @@ static int tonemap_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input) · 342 unmodified lines | |||
| 343 | int err; | 343 | int err; |
| 344 | double peak = ctx->peak; | 344 | double peak = ctx->peak; |
| 345 | 345 | ||
| 346 | AVHWFramesContext *input_frames_ctx = | 346 | AVHWFramesContext *input_frames_ctx; |
| 347 | (AVHWFramesContext*)input->hw_frames_ctx->data; | ||
| 348 | 347 | ||
| 349 | av_log(ctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n", | 348 | av_log(ctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n", |
| 350 | av_get_pix_fmt_name(input->format), | 349 | av_get_pix_fmt_name(input->format), |
| @@ -352,6 +351,7 @@ static int tonemap_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input) · 1 unmodified line | |||
| 352 | 351 | ||
| 353 | if (!input->hw_frames_ctx) | 352 | if (!input->hw_frames_ctx) |
| 354 | return AVERROR(EINVAL); | 353 | return AVERROR(EINVAL); |
| 354 | input_frames_ctx = (AVHWFramesContext*)input->hw_frames_ctx->data; | ||
| 355 | 355 | ||
| 356 | output = ff_get_video_buffer(outlink, outlink->w, outlink->h); | 356 | output = ff_get_video_buffer(outlink, outlink->w, outlink->h); |
| 357 | if (!output) { | 357 | if (!output) { |