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 commit11b6a82412
) Conflicts: libavfilter/formats.c Signed-off-by: Reinhard Tartler <siretart@tauware.de> (cherry picked from commite5f4e24942
) Signed-off-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commitb6c5848a1f
) Signed-off-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commita4e277312c
) Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:

committed by
Anton Khirnov

parent
6d6373dc64
commit
0dfcbe5285
@@ -43,6 +43,9 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
|
|||||||
AVFilterFormats *ret;
|
AVFilterFormats *ret;
|
||||||
unsigned i, j, k = 0;
|
unsigned i, j, k = 0;
|
||||||
|
|
||||||
|
if (a == b)
|
||||||
|
return a;
|
||||||
|
|
||||||
ret = av_mallocz(sizeof(AVFilterFormats));
|
ret = av_mallocz(sizeof(AVFilterFormats));
|
||||||
|
|
||||||
/* merge list of formats */
|
/* merge list of formats */
|
||||||
|
Reference in New Issue
Block a user