diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-05-29 15:38:21 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-06-04 17:20:04 +0200 |
commit | 274e134e49b1c92db0f0b8cb2ae7554fb7b9184c (patch) | |
tree | 056a41994d128ad49622f033f11d56148c65d910 | |
parent | 8b7dffc2d6c6c19f8e0a1fedcd0e95dce7a273ff (diff) | |
download | ffmpeg-274e134e49b1c92db0f0b8cb2ae7554fb7b9184c.tar.gz |
avconv: check that the output format context exists before accessing it
Fixes a segfault in exit_program() if opening an output file fails.
-rw-r--r-- | avconv.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -167,7 +167,7 @@ static void exit_program(void) /* close files */ for (i = 0; i < nb_output_files; i++) { AVFormatContext *s = output_files[i]->ctx; - if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb) + if (s && s->oformat && !(s->oformat->flags & AVFMT_NOFILE) && s->pb) avio_close(s->pb); avformat_free_context(s); av_dict_free(&output_files[i]->opts); |