mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-11 06:15:05 +00:00
gs-effect-technique: Fix possible crash
This commit is contained in:
parent
c420cee951
commit
570b70479f
1 changed files with 3 additions and 1 deletions
|
@ -33,7 +33,9 @@ gs::effect_technique::~effect_technique() {}
|
|||
|
||||
std::string gs::effect_technique::name()
|
||||
{
|
||||
return std::string(get()->name, get()->name + strnlen_s(get()->name, 256));
|
||||
const char* name_c = get()->name;
|
||||
size_t name_len = strnlen_s(name_c, 256);
|
||||
return name_c ? std::string(name_c, name_c + name_len) : std::string();
|
||||
}
|
||||
|
||||
size_t gs::effect_technique::count_passes()
|
||||
|
|
Loading…
Reference in a new issue