diff --git a/source/obs/gs/gs-effect.cpp b/source/obs/gs/gs-effect.cpp index 03915e39..6b11fdf4 100644 --- a/source/obs/gs/gs-effect.cpp +++ b/source/obs/gs/gs-effect.cpp @@ -726,7 +726,7 @@ void gs::effect_parameter::get_string(std::string& v) size_t ptr_len = gs_effect_get_val_size(_param); uint8_t* ptr = static_cast(gs_effect_get_val(_param)); if (ptr) { - v = std::string(ptr, ptr + ptr_len); + v = std::string(ptr, ptr + ptr_len - 1); bfree(ptr); } else { v = ""; @@ -740,7 +740,7 @@ void gs::effect_parameter::get_default_string(std::string& v) size_t ptr_len = gs_effect_get_default_val_size(_param); uint8_t* ptr = static_cast(gs_effect_get_default_val(_param)); if (ptr) { - v = std::string(ptr, ptr + ptr_len); + v = std::string(ptr, ptr + ptr_len - 1); bfree(ptr); } else { v = "";