aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-02 16:01:28 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-02 16:01:28 +0200
commit49ec4c7e49a4fe309d85a2e85a21ee526fc162c8 (patch)
tree945b129a93392d228edfbe9d6c8a6f0dc416cb63 /ffmpeg.c
parent6354a6ce5271a32857238a8ccb2107286984feb5 (diff)
downloadffmpeg-49ec4c7e49a4fe309d85a2e85a21ee526fc162c8.tar.gz
ffmpeg: fix segfault with random output
Found-by: <durandal_1707> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 86f5da3900..776312a96d 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -452,7 +452,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->flags & AVFMT_NOFILE) && s->pb)
avio_close(s->pb);
avformat_free_context(s);
av_dict_free(&output_files[i]->opts);