Commit 00457130 authored by Stefan Westerfeld's avatar Stefan Westerfeld

avfilter/asubprocess: fix leak in write_frame

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 892eae20
......@@ -585,6 +585,11 @@ static int write_frame(AVFilterContext *ctx, ASubProcessContext *s, AVFilterLink
s->nb_input_samples += in->nb_samples;
ret = write_samples(ctx, s, (int32_t *)in->data[0], in->nb_samples * inlink->ch_layout.nb_channels);
if (ret < 0) {
av_frame_free(&in);
return ret;
}
if (av_frame_is_writable(in)) {
out = in;
} else {
......@@ -593,8 +598,13 @@ static int write_frame(AVFilterContext *ctx, ASubProcessContext *s, AVFilterLink
av_frame_free(&in);
return AVERROR(ENOMEM);
}
av_frame_copy_props(out, in);
// TODO: LEAK
ret = av_frame_copy_props(out, in);
if (ret < 0) {
av_frame_free(&in);
av_frame_free(&out);
return ret;
}
av_frame_free(&in);
}
ff_framequeue_add(&s->frame_queue, out);
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment