diff --git a/ffmpeg.c b/ffmpeg.c index 53bcc4781f212dea8205e8c72533c24e3569b896..b9dc932e68861c5d0d13f0b02ca36c5213402e4a 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