From 79a0ec1af4817bb7b989803b9f460d1e4acaf7b7 Mon Sep 17 00:00:00 2001 From: Mina Nagy Zaki Date: Wed, 8 Jun 2011 19:24:25 +0300 Subject: 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. --- libavfilter/formats.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavfilter') diff --git a/libavfilter/formats.c b/libavfilter/formats.c index ec7fca3817..58593fcce0 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -44,6 +44,8 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b) AVFilterFormats *ret; unsigned i, j, k = 0; + if (a == b) return a; + ret = av_mallocz(sizeof(AVFilterFormats)); /* merge list of formats */ -- cgit v1.2.3