lib/ffmpeg/Filter: remove FilterContext destructor
Fixes potential double-free bugs which currently did not occur because the destructors happened to be called in the right order.
This commit is contained in:
		@@ -101,10 +101,10 @@ public:
 | 
				
			|||||||
	FilterContext(FilterContext &&src) noexcept
 | 
						FilterContext(FilterContext &&src) noexcept
 | 
				
			||||||
		:context(std::exchange(src.context, nullptr)) {}
 | 
							:context(std::exchange(src.context, nullptr)) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	~FilterContext() noexcept {
 | 
						/* note: we don't need a destructor calling avfilter_free()
 | 
				
			||||||
		if (context != nullptr)
 | 
						   here because the AVFilterGraph owns and frees all the
 | 
				
			||||||
			avfilter_free(context);
 | 
						   AVFilterContext instances */
 | 
				
			||||||
	}
 | 
						// TODO: do we really need this wrapper class anymore?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	FilterContext &operator=(FilterContext &&src) noexcept {
 | 
						FilterContext &operator=(FilterContext &&src) noexcept {
 | 
				
			||||||
		using std::swap;
 | 
							using std::swap;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user