fix: reading memory of stack allocated object past its scope (#91)
This commit is contained in:
@@ -370,7 +370,7 @@ std::string basename(const std::string& path) {
|
||||
return path;
|
||||
}
|
||||
|
||||
const char* get_image_params(SDParams params, int seed) {
|
||||
std::string get_image_params(SDParams params, int seed) {
|
||||
std::string parameter_string = params.prompt + "\n";
|
||||
if (params.negative_prompt.size() != 0) {
|
||||
parameter_string += "Negative prompt: " + params.negative_prompt + "\n";
|
||||
@@ -387,5 +387,5 @@ const char* get_image_params(SDParams params, int seed) {
|
||||
}
|
||||
parameter_string += ", ";
|
||||
parameter_string += "Version: stable-diffusion.cpp";
|
||||
return parameter_string.c_str();
|
||||
}
|
||||
return parameter_string;
|
||||
}
|
||||
|
||||
@@ -40,4 +40,4 @@ void print_usage(int argc, const char* argv[]);
|
||||
|
||||
void parse_args(int argc, const char** argv, SDParams& params);
|
||||
|
||||
const char* get_image_params(SDParams params, int seed);
|
||||
std::string get_image_params(SDParams params, int seed);
|
||||
|
||||
Reference in New Issue
Block a user