[FFmpeg-cvslog] lavfi: avfilter_merge_formats: handle case where inputs are same

Mina Nagy Zaki git at videolan.org
Mon Feb 11 12:41:03 CET 2013


ffmpeg | branch: release/0.5 | Mina Nagy Zaki <mnzaki at gmail.com> | Wed Jun  8 19:24:25 2011 +0300| [4475a7d88b89a6ff064f8917ee71657291d1a37a] | committer: Reinhard Tartler

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 at khirnov.net>
(cherry picked from commit 11b6a82412bcd372adf694a26d83b07d337e1325)

Conflicts:

	libavfilter/formats.c

Signed-off-by: Reinhard Tartler <siretart at tauware.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4475a7d88b89a6ff064f8917ee71657291d1a37a
---

 libavfilter/formats.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index c91f8b2..39b3453 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 */



More information about the ffmpeg-cvslog mailing list