avfilter: free link in/out_formats in avfilter_destroy()

Originally committed as revision 24718 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Måns Rullgård 2010-08-06 22:25:33 +00:00
parent 18b95d85f2
commit f3b90d25ee
1 changed files with 8 additions and 2 deletions

View File

@ -428,13 +428,19 @@ void avfilter_destroy(AVFilterContext *filter)
filter->filter->uninit(filter);
for(i = 0; i < filter->input_count; i ++) {
if(filter->inputs[i])
if(filter->inputs[i]) {
filter->inputs[i]->src->outputs[filter->inputs[i]->srcpad] = NULL;
avfilter_formats_unref(&filter->inputs[i]->in_formats);
avfilter_formats_unref(&filter->inputs[i]->out_formats);
}
av_freep(&filter->inputs[i]);
}
for(i = 0; i < filter->output_count; i ++) {
if(filter->outputs[i])
if(filter->outputs[i]) {
filter->outputs[i]->dst->inputs[filter->outputs[i]->dstpad] = NULL;
avfilter_formats_unref(&filter->outputs[i]->in_formats);
avfilter_formats_unref(&filter->outputs[i]->out_formats);
}
av_freep(&filter->outputs[i]);
}