[FFmpeg-cvslog] ffmpeg: fix segfault with random output

Michael Niedermayer git at videolan.org
Thu May 2 16:06:58 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu May  2 16:01:28 2013 +0200| [49ec4c7e49a4fe309d85a2e85a21ee526fc162c8] | committer: Michael Niedermayer

ffmpeg: fix segfault with random output

Found-by: <durandal_1707>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=49ec4c7e49a4fe309d85a2e85a21ee526fc162c8
---

 ffmpeg.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 86f5da3..776312a 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);



More information about the ffmpeg-cvslog mailing list