Browse Source

avfilter/avf_avectorscope: check if clone frame is set

tags/n4.3
Paul B Mahol 6 years ago
parent
commit
f9897eda43
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      libavfilter/avf_avectorscope.c

+ 6
- 1
libavfilter/avf_avectorscope.c View File

@@ -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)


Loading…
Cancel
Save