Commit 244622a0 authored by michael's avatar michael

write trailer before closing codecs as otherwise accesses to extradata in...

write trailer before closing codecs as otherwise accesses to extradata in write_trailer() will cause a segfault


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@2852 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 3f5d787b
...@@ -1510,6 +1510,12 @@ static int av_encode(AVFormatContext **output_files, ...@@ -1510,6 +1510,12 @@ static int av_encode(AVFormatContext **output_files,
/* dump report by using the first video and audio streams */ /* dump report by using the first video and audio streams */
print_report(output_files, ost_table, nb_ostreams, 1); 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 */ /* close each encoder */
for(i=0;i<nb_ostreams;i++) { for(i=0;i<nb_ostreams;i++) {
ost = ost_table[i]; ost = ost_table[i];
...@@ -1526,13 +1532,7 @@ static int av_encode(AVFormatContext **output_files, ...@@ -1526,13 +1532,7 @@ static int av_encode(AVFormatContext **output_files,
avcodec_close(&ist->st->codec); 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 ! */ /* finished ! */
ret = 0; ret = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment