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 | 343 | int err; |
| 344 | 344 | double peak = ctx->peak; |
| 345 | 345 | |
| 346 | − AVHWFramesContext *input_frames_ctx = | |
| 347 | − (AVHWFramesContext*)input->hw_frames_ctx->data; | |
| 346 | + AVHWFramesContext *input_frames_ctx; | |
| 348 | 347 | |
| 349 | 348 | av_log(ctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n", |
| 350 | 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 | 352 | if (!input->hw_frames_ctx) |
| 354 | 353 | return AVERROR(EINVAL); |
| 354 | + input_frames_ctx = (AVHWFramesContext*)input->hw_frames_ctx->data; | |
| 355 | 355 | |
| 356 | 356 | output = ff_get_video_buffer(outlink, outlink->w, outlink->h); |
| 357 | 357 | if (!output) { |