diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-03-08 05:46:46 +0400 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-03-08 05:46:46 +0400 |
commit | 199db97fbdd92c58b8f0e50eac60fead35e4dc57 (patch) | |
tree | f61347cfdac2e6ffee9afd698c0de095a500747b /ffmpeg.c | |
parent | a21fd660279c60359836a87a6f6a58850c2a6bb4 (diff) |
Close output codecs if input codec initialisation fails.
Fixes ticket #1546 and the remaining part of ticket #1244.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -2444,8 +2444,13 @@ static int transcode_init(void) /* init input streams */ for (i = 0; i < nb_input_streams; i++) - if ((ret = init_input_stream(i, error, sizeof(error))) < 0) + if ((ret = init_input_stream(i, error, sizeof(error))) < 0) { + for (i = 0; i < nb_output_streams; i++) { + ost = output_streams[i]; + avcodec_close(ost->st->codec); + } goto dump_format; + } /* discard unused programs */ for (i = 0; i < nb_input_files; i++) { |