From 8c3e65dfd850136353625449a859f69ed451fe14 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 4 Apr 2017 02:01:06 -0700 Subject: [PATCH] FFmpeg: Return false if a file fails to open --- CHANGES | 1 + src/feature/ffmpeg/ffmpeg-encoder.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 005646101..127b424c2 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,7 @@ Bugfixes: Misc: - Qt: Improved HiDPI support - Feature: Support ImageMagick 7 + - FFmpeg: Return false if a file fails to open 0.5.2: (2016-12-31) Bugfixes: diff --git a/src/feature/ffmpeg/ffmpeg-encoder.c b/src/feature/ffmpeg/ffmpeg-encoder.c index c7c96c3d1..d0374d46c 100644 --- a/src/feature/ffmpeg/ffmpeg-encoder.c +++ b/src/feature/ffmpeg/ffmpeg-encoder.c @@ -320,7 +320,9 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) { avcodec_parameters_from_context(encoder->videoStream->codecpar, encoder->video); #endif - avio_open(&encoder->context->pb, outfile, AVIO_FLAG_WRITE); + if (avio_open(&encoder->context->pb, outfile, AVIO_FLAG_WRITE) < 0) { + return false; + } return avformat_write_header(encoder->context, 0) >= 0; }