aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMina Nagy Zaki <mnzaki@gmail.com>2011-06-08 19:24:25 +0300
committerAnton Khirnov <anton@khirnov.net>2012-10-06 08:43:43 +0200
commite5f4e249422834f727bcd432b73af971277f1371 (patch)
tree8350e09ea43d49623fee5d2bd78c523d70b6508c
parentb1ad5a21da7ac56b853b6a21ed08a075ecbb89c6 (diff)
downloadffmpeg-e5f4e249422834f727bcd432b73af971277f1371.tar.gz
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 11b6a82412bcd372adf694a26d83b07d337e1325) Conflicts: libavfilter/formats.c Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavfilter/formats.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index 8c5041a8fe..7eca639489 100644
--- a/libavfilter/formats.c
+++ b/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(AVFilterFormats));
/* merge list of formats */