aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-03-08 02:46:46 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-03-08 02:46:46 +0100
commit199db97fbdd92c58b8f0e50eac60fead35e4dc57 (patch)
treef61347cfdac2e6ffee9afd698c0de095a500747b
parenta21fd660279c60359836a87a6f6a58850c2a6bb4 (diff)
downloadffmpeg-199db97fbdd92c58b8f0e50eac60fead35e4dc57.tar.gz
Close output codecs if input codec initialisation fails.
Fixes ticket #1546 and the remaining part of ticket #1244.
-rw-r--r--ffmpeg.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index c88665e500..2ea3694394 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -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++) {