OSDN Git Service

* fix leak with output file closing
authorZdenek Kabelac <kabi@informatics.muni.cz>
Tue, 5 Nov 2002 11:59:47 +0000 (11:59 +0000)
committerZdenek Kabelac <kabi@informatics.muni.cz>
Tue, 5 Nov 2002 11:59:47 +0000 (11:59 +0000)
Originally committed as revision 1166 to svn://svn.ffmpeg.org/ffmpeg/trunk

ffmpeg.c

index 53bcc47..b9dc932 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2567,8 +2567,14 @@ int main(int argc, char **argv)
 
     /* close files */
     for(i=0;i<nb_output_files;i++) {
-        if (!(output_files[i]->oformat->flags & AVFMT_NOFILE)) 
-            url_fclose(&output_files[i]->pb);
+        /* maybe av_close_output_file ??? */
+        AVFormatContext *s = output_files[i];
+       int j;
+        if (!(s->oformat->flags & AVFMT_NOFILE))
+           url_fclose(&s->pb);
+       for(j=0;j<s->nb_streams;j++)
+           av_free(s->streams[j]);
+        av_free(s);
     }
     for(i=0;i<nb_input_files;i++)
         av_close_input_file(input_files[i]);