Commit a4e27731 authored by Mina Nagy Zaki's avatar Mina Nagy Zaki Committed by Anton Khirnov

lavfi: avfilter_merge_formats: handle case where inputs are same

This fixes a double-free crash if lists are the same due to the two
merge_ref() calls at the end of the (useless) merging that happens.
Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
(cherry picked from commit 11b6a824)

Conflicts:

	libavfilter/formats.c
Signed-off-by: 's avatarReinhard Tartler <siretart@tauware.de>
(cherry picked from commit e5f4e249)
Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
(cherry picked from commit b6c5848a)
Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent c82ae85a
......@@ -44,6 +44,9 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
AVFilterFormats *ret;
unsigned i, j, k = 0;
if (a == b)
return a;
ret = av_mallocz(sizeof(AVFilterFormats));
/* merge list of formats */
......
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