[FFmpeg-cvslog] avfilter/vf_dedot: fix crash

Paul B Mahol git at videolan.org
Thu Oct 17 12:54:10 EEST 2019


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Oct 17 11:51:22 2019 +0200| [8f63c4e72a8c2ccf71b566e8f41fb66bee28a52d] | committer: Paul B Mahol

avfilter/vf_dedot: fix crash

Fixes #8299

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

 libavfilter/vf_dedot.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_dedot.c b/libavfilter/vf_dedot.c
index bb0f9e5ac8..ae5ef8f169 100644
--- a/libavfilter/vf_dedot.c
+++ b/libavfilter/vf_dedot.c
@@ -283,7 +283,7 @@ static int activate(AVFilterContext *ctx)
                     s->frames[i] = av_frame_clone(frame);
             }
             av_frame_free(&frame);
-        } else {
+        } else if (s->frames[3]) {
             s->eof_frames--;
             s->frames[4] = av_frame_clone(s->frames[3]);
         }
@@ -343,7 +343,11 @@ static int activate(AVFilterContext *ctx)
     if (!s->eof && ff_inlink_acknowledge_status(inlink, &status, &pts)) {
         if (status == AVERROR_EOF) {
             s->eof = 1;
-            s->eof_frames = 2;
+            s->eof_frames = !!s->frames[0] + !!s->frames[1];
+            if (s->eof_frames <= 0) {
+                ff_outlink_set_status(outlink, AVERROR_EOF, pts);
+                return 0;
+            }
             ff_filter_set_ready(ctx, 10);
             return 0;
         }



More information about the ffmpeg-cvslog mailing list