Video: Fix an issue with very long filenames

This commit is contained in:
Jeffrey Pfau 2015-04-23 23:57:06 -07:00
parent 3ae3b292ee
commit 73dd9ed3f8
2 changed files with 3 additions and 1 deletions

View File

@ -38,6 +38,7 @@ Bugfixes:
- Util: Fix resource leak in UTF-8 handling code
- VFS: Fix resource leaks if some allocations fail
- Debugger: Fix boundary conditions in tab completion
- Video: Fix an issue with very long filenames
Misc:
- Qt: Show multiplayer numbers in window title
- Qt: Handle saving input settings better

View File

@ -202,7 +202,8 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
avformat_alloc_output_context2(&encoder->context, oformat, 0, outfile);
#else
encoder->context = avformat_alloc_context();
strncpy(encoder->context->filename, outfile, sizeof(encoder->context->filename));
strncpy(encoder->context->filename, outfile, sizeof(encoder->context->filename) - 1);
encoder->context->filename[sizeof(encoder->context->filename) - 1] = '\0';
encoder->context->oformat = oformat;
#endif