From 4fca59f2abeff94f306ccf4a6b232da51c5bad38 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 5 Nov 2002 11:59:47 +0000 Subject: [PATCH] * fix leak with output file closing Originally committed as revision 1166 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffmpeg.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 53bcc4781f..b9dc932e68 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -2567,8 +2567,14 @@ int main(int argc, char **argv) /* close files */ for(i=0;ioformat->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;jnb_streams;j++) + av_free(s->streams[j]); + av_free(s); } for(i=0;i