1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

Close output codecs if input codec initialisation fails.

Fixes ticket #1546 and the remaining part of ticket #1244.
This commit is contained in:
Carl Eugen Hoyos 2013-03-08 02:46:46 +01:00
parent a21fd66027
commit 199db97fbd

View File

@ -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++) {