avfilter/avf_aphasemeter: check if clone frame is set
authorPaul B Mahol <onemda@gmail.com>
Tue, 14 Jan 2020 15:41:15 +0000 (16:41 +0100)
committerPaul B Mahol <onemda@gmail.com>
Tue, 14 Jan 2020 15:52:07 +0000 (16:52 +0100)
libavfilter/avf_aphasemeter.c

index f497bc9..be0b2fb 100644 (file)
@@ -213,8 +213,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     }
 
     if (s->do_video) {
+        AVFrame *clone;
+
         s->out->pts = in->pts;
-        ff_filter_frame(outlink, av_frame_clone(s->out));
+        clone = av_frame_clone(s->out);
+        if (!clone)
+            return AVERROR(ENOMEM);
+        ff_filter_frame(outlink, clone);
     }
     return ff_filter_frame(aoutlink, in);
 }