summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMina Nagy Zaki <mnzaki@gmail.com>2011-06-08 19:24:25 +0300
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2011-06-10 13:04:47 +0200
commit79a0ec1af4817bb7b989803b9f460d1e4acaf7b7 (patch)
tree5d8befa764836cdb38d77670310f35108d1b6a04
parent989184fea4854720caef35347992499ba8033195 (diff)
downloadffmpeg-streaming-79a0ec1af4817bb7b989803b9f460d1e4acaf7b7.zip
ffmpeg-streaming-79a0ec1af4817bb7b989803b9f460d1e4acaf7b7.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.
-rw-r--r--libavfilter/formats.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index ec7fca3..58593fc 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 */
OpenPOWER on IntegriCloud