aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMina Nagy Zaki <mnzaki@gmail.com>2011-06-08 19:24:25 +0300
committerReinhard Tartler <siretart@tauware.de>2013-02-10 18:01:15 +0100
commit4475a7d88b89a6ff064f8917ee71657291d1a37a (patch)
tree3c1c9c84101ab2603113122feecf8c946cb0c407
parent0f6d4da8def2c697b2512a12285a227ec7d5bb9b (diff)
downloadffmpeg-4475a7d88b89a6ff064f8917ee71657291d1a37a.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 c91f8b2cf8..39b3453e41 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -46,6 +46,9 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
if (a == b)
return a;
+ if (a == b)
+ return a;
+
ret = av_mallocz(sizeof(AVFilterFormats));
/* merge list of formats */