[FFmpeg-cvslog] ffmpeg/set_encoder_id: dont allocate encoder string if one is already set

Michael Niedermayer git at videolan.org
Tue May 20 00:56:20 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue May 20 00:50:27 2014 +0200| [b2a8bc3d048280c3fc664250af953821a8784c00] | committer: Michael Niedermayer

ffmpeg/set_encoder_id: dont allocate encoder string if one is already set

Fixes memleak

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 ffmpeg.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index 7ec5889..eafcf0f 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2377,6 +2377,9 @@ static void set_encoder_id(OutputFile *of, OutputStream *ost)
     int format_flags = 0;
     int codec_flags = 0;
 
+    if (av_dict_get(ost->st->metadata, "encoder",  NULL, 0))
+        return;
+
     e = av_dict_get(of->opts, "fflags", NULL, 0);
     if (e) {
         const AVOption *o = av_opt_find(of->ctx, "fflags", NULL, 0, 0);



More information about the ffmpeg-cvslog mailing list