[FFmpeg-cvslog] avconv: check that the output format context exists before accessing it
Anton Khirnov
git at videolan.org
Wed Jun 5 12:25:17 CEST 2013
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed May 29 15:38:21 2013 +0200| [274e134e49b1c92db0f0b8cb2ae7554fb7b9184c] | committer: Anton Khirnov
avconv: check that the output format context exists before accessing it
Fixes a segfault in exit_program() if opening an output file fails.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=274e134e49b1c92db0f0b8cb2ae7554fb7b9184c
---
avconv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/avconv.c b/avconv.c
index cce9a83..4808235 100644
--- a/avconv.c
+++ b/avconv.c
@@ -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);
More information about the ffmpeg-cvslog
mailing list