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: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 11b6a82412)
Conflicts:
libavfilter/formats.c
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:
parent
b1ad5a21da
commit
e5f4e24942
1 changed files with 3 additions and 0 deletions
|
|
@ -45,6 +45,9 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
|
|||
AVFilterFormats *ret;
|
||||
unsigned i, j, k = 0, m_count;
|
||||
|
||||
if (a == b)
|
||||
return a;
|
||||
|
||||
ret = av_mallocz(sizeof(AVFilterFormats));
|
||||
|
||||
/* merge list of formats */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue