summaryrefslogtreecommitdiff
path: root/libavfilter/avf_avectorscope.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-01-14 14:22:17 +0100
committerPaul B Mahol <onemda@gmail.com>2020-01-14 16:52:07 +0100
commitf9897eda43f8f2285593b41ff0efa8bfbad431e2 (patch)
tree4bff6a85fd36b0d6d62957c5ed68dc0eb6b69995 /libavfilter/avf_avectorscope.c
parent4e1ae43b17a50f125e63acc33ea2d25a1965fe69 (diff)
downloadffmpeg-f9897eda43f8f2285593b41ff0efa8bfbad431e2.tar.gz
avfilter/avf_avectorscope: check if clone frame is set
Diffstat (limited to 'libavfilter/avf_avectorscope.c')
-rw-r--r--libavfilter/avf_avectorscope.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavfilter/avf_avectorscope.c b/libavfilter/avf_avectorscope.c
index 0f53b36dfb..b288ff63ff 100644
--- a/libavfilter/avf_avectorscope.c
+++ b/libavfilter/avf_avectorscope.c
@@ -238,6 +238,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
AudioVectorScopeContext *s = ctx->priv;
const int hw = s->hw;
const int hh = s->hh;
+ AVFrame *clone;
unsigned x, y;
unsigned prev_x = s->prev_x, prev_y = s->prev_y;
double zoom = s->zoom;
@@ -360,7 +361,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
s->prev_x = x, s->prev_y = y;
av_frame_free(&insamples);
- return ff_filter_frame(outlink, av_frame_clone(s->outpicref));
+ clone = av_frame_clone(s->outpicref);
+ if (!clone)
+ return AVERROR(ENOMEM);
+
+ return ff_filter_frame(outlink, clone);
}
static int activate(AVFilterContext *ctx)