[FFmpeg-devel] [PATCH] free AVFormatContext::key

Reimar Döffinger Reimar.Doeffinger
Sat Sep 25 11:20:56 CEST 2010


Hello,
this is malloc'd by the AVOptions, but never freed.
The easiest solution is to free it manually, though we
could probably add a AVOptions API that frees everything
it has allocated...
Index: ffmpeg.c
===================================================================
--- ffmpeg.c    (revision 25163)
+++ ffmpeg.c    (working copy)
@@ -603,8 +603,10 @@
         av_metadata_free(&s->metadata);
         av_free(s);
     }
-    for(i=0;i<nb_input_files;i++)
+    for(i=0;i<nb_input_files;i++) {
+        av_freep(&input_files[i]->key);
         av_close_input_file(input_files[i]);
+    }
 
     av_free(intra_matrix);
     av_free(inter_matrix);



More information about the ffmpeg-devel mailing list