You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Potential crash when using unicode characters in filename #11211
Obs should not crash on start recording, no matter what the user decided to put in the filename formatting.
Current Behavior
os_generate_formatted_filename crops the generated filename to 255 bytes, before returning it. However, unicode characters can be more than one byte, as such, this cropping can turn the last character of the filename into an invalid character if the cropping happens in its middle.
This then causes a crash when said filename is attempted to be used.
Steps to Reproduce
Change filename formatting to %CCYY-%MM-%DD %hh-%mm-%ss foobar (there's 100 zero-width spaces between the foo and the bar, so, copy-paste)
Press "Start Recording"
Notice crash
...
N.B.: the error doesn't appear in the log itself :
terminate called after throwing an instance of 'nlohmann::detail::type_error'
what(): [json.exception.type_error.316] incomplete UTF-8 string; last byte: 0xE2
Aborted (core dumped)
Anything else we should know?
Honestly, the impact of this is probably rather minimal, it only surfaced because Call of Duty are weirdos and put something like 70 zero-width spaces in their window title for no reason whatsoever.
Slightly related, and possibly worthy to include in a fix : said 255 bytes crop happens after applying the extension, and as such will often create an extension-less file, which crashes the muxer.
Activity
Penwy commentedon Aug 28, 2024
Slightly related, and possibly worthy to include in a fix : said 255 bytes crop happens after applying the extension, and as such will often create an extension-less file, which crashes the muxer.