aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-01-14 16:38:49 +0100
committerPaul B Mahol <onemda@gmail.com>2020-01-14 16:52:07 +0100
commitd580c7a7979613f352cfc9701f7ff4fe83b33af2 (patch)
tree4ca8f1a34e0d20d71955d529c633cd9d9add3dc5 /libavfilter
parent928020b9d01a9bfb3de23a625ed2321a48467bcf (diff)
downloadffmpeg-d580c7a7979613f352cfc9701f7ff4fe83b33af2.tar.gz
avfilter/avf_ahistogram: check if frame clone is set
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/avf_ahistogram.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavfilter/avf_ahistogram.c b/libavfilter/avf_ahistogram.c
index a0931bfa58..92cda46756 100644
--- a/libavfilter/avf_ahistogram.c
+++ b/libavfilter/avf_ahistogram.c
@@ -163,6 +163,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
const int w = s->w;
int c, y, n, p, bin;
uint64_t acmax = 1;
+ AVFrame *clone;
if (!s->out || s->out->width != outlink->w ||
s->out->height != outlink->h) {
@@ -363,7 +364,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
s->ypos = H;
}
- return ff_filter_frame(outlink, av_frame_clone(s->out));
+ clone = av_frame_clone(s->out);
+ if (!clone)
+ return AVERROR(ENOMEM);
+
+ return ff_filter_frame(outlink, clone);
}
static int activate(AVFilterContext *ctx)