summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorJai Menon <jmenon86@gmail.com>2010-07-18 18:20:41 +0000
committerJai Menon <jmenon86@gmail.com>2010-07-18 18:20:41 +0000
commitd62ccec8b17f5806c397e4a4daccaf4f700ec5d4 (patch)
tree33dccd3eef18fb2942626e376f82ae944eeab13c /ffmpeg.c
parent387fe82c95758fb8491edc060c08bf7d83ed24fd (diff)
FFmpeg : Replace some av_exit calls in av_transcode with branches to the
cleanup code. This plugs a bunch of memleaks. Originally committed as revision 24305 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index de15898138..af6f9dbd78 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2007,13 +2007,15 @@ static int av_transcode(AVFormatContext **output_files,
if (!os->nb_streams) {
dump_format(output_files[i], i, output_files[i]->filename, 1);
fprintf(stderr, "Output file #%d does not contain any stream\n", i);
- av_exit(1);
+ ret = AVERROR(EINVAL);
+ goto fail;
}
nb_ostreams += os->nb_streams;
}
if (nb_stream_maps > 0 && nb_stream_maps != nb_ostreams) {
fprintf(stderr, "Number of stream maps must match number of output streams\n");
- av_exit(1);
+ ret = AVERROR(EINVAL);
+ goto fail;
}
/* Sanity check the mapping args -- do the input files & streams exist? */
@@ -2024,14 +2026,16 @@ static int av_transcode(AVFormatContext **output_files,
if (fi < 0 || fi > nb_input_files - 1 ||
si < 0 || si > file_table[fi].nb_streams - 1) {
fprintf(stderr,"Could not find input stream #%d.%d\n", fi, si);
- av_exit(1);
+ ret = AVERROR(EINVAL);
+ goto fail;
}
fi = stream_maps[i].sync_file_index;
si = stream_maps[i].sync_stream_index;
if (fi < 0 || fi > nb_input_files - 1 ||
si < 0 || si > file_table[fi].nb_streams - 1) {
fprintf(stderr,"Could not find sync stream #%d.%d\n", fi, si);
- av_exit(1);
+ ret = AVERROR(EINVAL);
+ goto fail;
}
}