aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-03-05 22:51:22 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-03-05 22:51:22 +0000
commitc4e3724713a0f2903224999da1f12a15e96a2811 (patch)
tree0ec80cd637a2aae92ba7597c0bcf76c819524ceb /ffmpeg.c
parent615b92fd8eb1a67acfa1799f5ba3f50cd8aac688 (diff)
downloadffmpeg-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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 86fbf3d5b4..bbb6fabe47 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -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;