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

index ee82474..c974fd5 100644 (file)
@@ -733,13 +733,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
     }
 
     if (s->draw_curves) {
+        AVFrame *clone;
+
         const int64_t pts = buf->pts +
             av_rescale_q(buf->nb_samples, (AVRational){ 1, inlink->sample_rate },
                          outlink->time_base);
         int ret;
 
         s->video->pts = pts;
-        ret = ff_filter_frame(ctx->outputs[1], av_frame_clone(s->video));
+        clone = av_frame_clone(s->video);
+        if (!clone)
+            return AVERROR(ENOMEM);
+        ret = ff_filter_frame(ctx->outputs[1], clone);
         if (ret < 0)
             return ret;
     }