mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
utils: Fix use-after-free in GetLastReplayBufferFileName
This commit is contained in:
parent
47f9beb095
commit
9bdf560bf8
@ -101,13 +101,14 @@ std::string Utils::Obs::StringHelper::GetLastReplayBufferFileName()
|
|||||||
calldata_t cd = {0};
|
calldata_t cd = {0};
|
||||||
proc_handler_t *ph = obs_output_get_proc_handler(output);
|
proc_handler_t *ph = obs_output_get_proc_handler(output);
|
||||||
proc_handler_call(ph, "get_last_replay", &cd);
|
proc_handler_call(ph, "get_last_replay", &cd);
|
||||||
const char *savedReplayPath = calldata_string(&cd, "path");
|
const char *pathBuffer = calldata_string(&cd, "path");
|
||||||
|
|
||||||
|
std::string ret;
|
||||||
|
if (pathBuffer)
|
||||||
|
ret = pathBuffer;
|
||||||
|
|
||||||
calldata_free(&cd);
|
calldata_free(&cd);
|
||||||
|
return ret;
|
||||||
if (!savedReplayPath)
|
|
||||||
return "";
|
|
||||||
|
|
||||||
return savedReplayPath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Utils::Obs::StringHelper::DurationToTimecode(uint64_t ms)
|
std::string Utils::Obs::StringHelper::DurationToTimecode(uint64_t ms)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user