diff options
author | Mina Nagy Zaki <mnzaki@gmail.com> | 2011-06-08 19:24:25 +0300 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-05-07 07:08:59 +0200 |
commit | 11b6a82412bcd372adf694a26d83b07d337e1325 (patch) | |
tree | 040fa79e0e290d3cd90aab741809a4cdaace8770 | |
parent | 828bd088f3f74dcdb8451d58557b0d8caefa3227 (diff) | |
download | ffmpeg-11b6a82412bcd372adf694a26d83b07d337e1325.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>
-rw-r--r-- | libavfilter/formats.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 9d048d7be2..206eff5587 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(*ret)); /* merge list of formats */ |