[FFmpeg-cvslog] avfilter/vf_tpad: if there is no frame to clone return early

Paul B Mahol git at videolan.org
Thu Feb 24 22:30:38 EET 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Feb 24 20:32:41 2022 +0100| [3715f2f8643695940582ce040b7a052cccfb9db2] | committer: Paul B Mahol

avfilter/vf_tpad: if there is no frame to clone return early

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

 libavfilter/vf_tpad.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/vf_tpad.c b/libavfilter/vf_tpad.c
index e5acece1e4..120dbcb4d3 100644
--- a/libavfilter/vf_tpad.c
+++ b/libavfilter/vf_tpad.c
@@ -148,6 +148,11 @@ static int activate(AVFilterContext *ctx)
                               frame->data, frame->linesize,
                               0, 0, frame->width, frame->height);
         } else if (s->stop_mode == 1) {
+            if (!s->cache_stop) {
+                s->pad_stop = 0;
+                ff_outlink_set_status(outlink, AVERROR_EOF, s->pts);
+                return 0;
+            }
             frame = av_frame_clone(s->cache_stop);
             if (!frame)
                 return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list