diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-03-05 22:51:22 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-03-05 22:51:22 +0000 |
commit | c4e3724713a0f2903224999da1f12a15e96a2811 (patch) | |
tree | 0ec80cd637a2aae92ba7597c0bcf76c819524ceb /ffmpeg.c | |
parent | 615b92fd8eb1a67acfa1799f5ba3f50cd8aac688 (diff) | |
download | ffmpeg-c4e3724713a0f2903224999da1f12a15e96a2811.tar.gz |
write trailer before closing codecs as otherwise accesses to extradata in write_trailer() will cause a segfault
Originally committed as revision 2852 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1510,6 +1510,12 @@ static int av_encode(AVFormatContext **output_files, /* dump report by using the first video and audio streams */ print_report(output_files, ost_table, nb_ostreams, 1); + /* write the trailer if needed and close file */ + for(i=0;i<nb_output_files;i++) { + os = output_files[i]; + av_write_trailer(os); + } + /* close each encoder */ for(i=0;i<nb_ostreams;i++) { ost = ost_table[i]; @@ -1526,13 +1532,7 @@ static int av_encode(AVFormatContext **output_files, avcodec_close(&ist->st->codec); } } - - /* write the trailer if needed and close file */ - for(i=0;i<nb_output_files;i++) { - os = output_files[i]; - av_write_trailer(os); - } /* finished ! */ ret = 0; |