summaryrefslogtreecommitdiff
path: root/libavfilter/avf_ahistogram.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-02-06 14:57:50 +0100
committerPaul B Mahol <onemda@gmail.com>2023-02-12 13:32:00 +0100
commite506ea3ce1de0c782b2b833398240c8e19a02bb4 (patch)
tree09a019d09e096300024c435d15c3485d319bad04 /libavfilter/avf_ahistogram.c
parent78f46065d861eb8487124e92ab46a459426eb89c (diff)
downloadffmpeg-e506ea3ce1de0c782b2b833398240c8e19a02bb4.tar.gz
avfilter: use ff_inlink_make_frame_writable()
Diffstat (limited to 'libavfilter/avf_ahistogram.c')
-rw-r--r--libavfilter/avf_ahistogram.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavfilter/avf_ahistogram.c b/libavfilter/avf_ahistogram.c
index c45493730d..06490192a5 100644
--- a/libavfilter/avf_ahistogram.c
+++ b/libavfilter/avf_ahistogram.c
@@ -209,7 +209,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AudioHistogramContext *s = ctx->priv;
const int H = s->histogram_h;
const int w = s->w;
- int c, y, n, p, bin;
+ int c, y, n, p, bin, ret;
uint64_t acmax = 1;
AVFrame *clone;
@@ -229,7 +229,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
}
}
- av_frame_make_writable(s->out);
+ ret = ff_inlink_make_frame_writable(outlink, &s->out);
+ if (ret < 0) {
+ av_frame_free(&in);
+ return ret;
+ }
+
if (s->dmode == SEPARATE) {
for (y = 0; y < w; y++) {
s->combine_buffer[3 * y ] = 0;