FFmpeg: Return false if a file fails to open

This commit is contained in:
Vicki Pfau 2017-04-04 02:01:06 -07:00
parent f2ce0d11dc
commit 8c3e65dfd8
2 changed files with 4 additions and 1 deletions

View File

@ -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:

View File

@ -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;
}