diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-01-14 16:07:35 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-01-14 16:52:07 +0100 |
commit | 2a9a52b913f0d409c97e63418accda4a65c265aa (patch) | |
tree | e59f97dc737d7323538f5fd0d93e47cf38972793 | |
parent | f9897eda43f8f2285593b41ff0efa8bfbad431e2 (diff) | |
download | ffmpeg-2a9a52b913f0d409c97e63418accda4a65c265aa.tar.gz |
avfilter/af_afir: check if frame clone is set
-rw-r--r-- | libavfilter/af_afir.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c index 077f9c7962..7c7e8458d4 100644 --- a/libavfilter/af_afir.c +++ b/libavfilter/af_afir.c @@ -670,8 +670,12 @@ static int activate(AVFilterContext *ctx) int64_t new_pts = av_rescale_q(s->pts, ctx->inputs[0]->time_base, ctx->outputs[1]->time_base); if (ff_outlink_frame_wanted(ctx->outputs[1]) && old_pts < new_pts) { + AVFrame *clone; s->video->pts = new_pts; - return ff_filter_frame(ctx->outputs[1], av_frame_clone(s->video)); + clone = av_frame_clone(s->video); + if (!clone) + return AVERROR(ENOMEM); + return ff_filter_frame(ctx->outputs[1], clone); } } |