1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avfilter/af_anequalizer: check if frame clone is set

This commit is contained in:
Paul B Mahol 2020-01-14 16:14:46 +01:00
parent 80c4c336f9
commit f6f6857c2a

View File

@ -733,13 +733,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
} }
if (s->draw_curves) { if (s->draw_curves) {
AVFrame *clone;
const int64_t pts = buf->pts + const int64_t pts = buf->pts +
av_rescale_q(buf->nb_samples, (AVRational){ 1, inlink->sample_rate }, av_rescale_q(buf->nb_samples, (AVRational){ 1, inlink->sample_rate },
outlink->time_base); outlink->time_base);
int ret; int ret;
s->video->pts = pts; 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) if (ret < 0)
return ret; return ret;
} }