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

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


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Jan 14 16:46:50 2020 +0100| [7e4b0d377f275676105191b49eb3f096c6d60098] | committer: Paul B Mahol

avfilter/avf_showspectrum: check if frame clone is set

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

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

diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 3a3ef7eb31..a4dd7b7879 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -1365,6 +1365,8 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples)
         s->xpos = 0;
     if (!s->single_pic && (s->sliding != FULLFRAME || s->xpos == 0)) {
         if (s->old_pts < outpicref->pts) {
+            AVFrame *clone;
+
             if (s->legend) {
                 char *units = get_time(ctx, insamples->pts /(float)inlink->sample_rate, x);
                 if (!units)
@@ -1393,7 +1395,10 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples)
                 av_free(units);
             }
             s->old_pts = outpicref->pts;
-            ret = ff_filter_frame(outlink, av_frame_clone(s->outpicref));
+            clone = av_frame_clone(s->outpicref);
+            if (!clone)
+                return AVERROR(ENOMEM);
+            ret = ff_filter_frame(outlink, clone);
             if (ret < 0)
                 return ret;
             return 0;



More information about the ffmpeg-cvslog mailing list