Commit a80a1199 authored by Stefan Westerfeld's avatar Stefan Westerfeld

avfilter/asubprocess: free memory in uninit()

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent e5368cda
......@@ -87,6 +87,17 @@ static SPB *spb_new(AVFilterContext *ctx)
return spb;
}
static void spb_free_all(SPB **spbp)
{
SPB *spb = *spbp;
while (spb) {
SPB *to_free = spb;
spb = spb->next;
av_free(to_free);
}
*spbp = NULL;
}
static int
sp_new(AVFilterContext *ctx)
{
......@@ -399,6 +410,11 @@ static av_cold void uninit(AVFilterContext *ctx)
{
ASubProcessContext *s = ctx->priv;
if (s->sp) {
spb_free_all(&s->sp->unused_buffers);
spb_free_all(&s->sp->out_buffers);
av_freep(&s->sp);
}
ff_framequeue_free(&s->frame_queue);
av_freep(&s->sample_buffer);
}
......
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