File fix-fribidi-output-size.patch of Package marsshooter

Description: Use correct output size for fribidi_unicode_to_charset
 The fribidi_unicode_to_charset writes a null terminating byte to the
 output string, so the output buffer needs to be one more than the size
 needed for the actual characters.
Author: James Cowgill <jcowgill@debian.org>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/Media/file.cpp
+++ b/src/Media/file.cpp
@@ -60,7 +60,7 @@ namespace file {
                 FriBidiParType base = FRIBIDI_PAR_LTR;
                 fribidi_log2vis(logical.data(), outSize, &base, visual.data(), NULL, NULL, NULL);
 
-                std::vector<char> outstring(outSize * 4, 0);
+                std::vector<char> outstring(outSize * 4 + 1, 0);
                 fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_UTF8, visual.data(), outSize, outstring.data());
 
                 line = std::string(outstring.data());
openSUSE Build Service is sponsored by