You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	avfilter/avfiltergraph: Clear graph pointers in ff_filter_graph_remove_filter()
When a filter is no longer part of a graph, its pointers should be cleared so no stale pointers remain. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
		| @@ -93,12 +93,17 @@ AVFilterGraph *avfilter_graph_alloc(void) | ||||
|  | ||||
| void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter) | ||||
| { | ||||
|     int i; | ||||
|     int i, j; | ||||
|     for (i = 0; i < graph->nb_filters; i++) { | ||||
|         if (graph->filters[i] == filter) { | ||||
|             FFSWAP(AVFilterContext*, graph->filters[i], | ||||
|                    graph->filters[graph->nb_filters - 1]); | ||||
|             graph->nb_filters--; | ||||
|             filter->graph = NULL; | ||||
|             for (j = 0; j<filter->nb_outputs; j++) | ||||
|                 if (filter->outputs[j]) | ||||
|                     filter->outputs[j]->graph = NULL; | ||||
|  | ||||
|             return; | ||||
|         } | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user