libavfilter/af_amerge: fix segfault if init fails.

This commit is contained in:
Nicolas George 2013-02-21 20:15:08 +01:00
parent 066739f6bc
commit bf0712c2f8
1 changed files with 4 additions and 2 deletions

View File

@ -63,8 +63,10 @@ static av_cold void uninit(AVFilterContext *ctx)
int i; int i;
for (i = 0; i < am->nb_inputs; i++) { for (i = 0; i < am->nb_inputs; i++) {
ff_bufqueue_discard_all(&am->in[i].queue); if (am->in)
av_freep(&ctx->input_pads[i].name); ff_bufqueue_discard_all(&am->in[i].queue);
if (ctx->input_pads)
av_freep(&ctx->input_pads[i].name);
} }
av_freep(&am->in); av_freep(&am->in);
} }