You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avconv: check that the output format context exists before accessing it
Fixes a segfault in exit_program() if opening an output file fails.
This commit is contained in:
2
avconv.c
2
avconv.c
@@ -167,7 +167,7 @@ static void exit_program(void)
|
|||||||
/* close files */
|
/* close files */
|
||||||
for (i = 0; i < nb_output_files; i++) {
|
for (i = 0; i < nb_output_files; i++) {
|
||||||
AVFormatContext *s = output_files[i]->ctx;
|
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);
|
avio_close(s->pb);
|
||||||
avformat_free_context(s);
|
avformat_free_context(s);
|
||||||
av_dict_free(&output_files[i]->opts);
|
av_dict_free(&output_files[i]->opts);
|
||||||
|
Reference in New Issue
Block a user