[FFmpeg-cvslog] avfilter/af_afir: check if frame clone is set

Paul B Mahol git at videolan.org
Tue Jan 14 17:57:12 EET 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Jan 14 16:07:35 2020 +0100| [2a9a52b913f0d409c97e63418accda4a65c265aa] | committer: Paul B Mahol

avfilter/af_afir: check if frame clone is set

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2a9a52b913f0d409c97e63418accda4a65c265aa
---

 libavfilter/af_afir.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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);
         }
     }
 



More information about the ffmpeg-cvslog mailing list