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>
pull/30/merge
Mina Nagy Zaki 14 years ago committed by Anton Khirnov
parent 828bd088f3
commit 11b6a82412
  1. 3
      libavfilter/formats.c

@ -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(*ret));
/* merge list of formats */

Loading…
Cancel
Save