prevent segfault on load fail

This commit is contained in:
Concedo
2026-09-13 22:01:18 +08:00
parent bcc718d836
commit 49b9132287
4 changed files with 19 additions and 4 deletions
+5
View File
@@ -35,6 +35,11 @@ extern "C"
draftmodel_filename = inputs.draftmodel_filename;
file_format = check_file_format(model.c_str(),&file_format_meta);
if (file_format == FileFormat::BADFORMAT)
{
fprintf(stderr, "%s: error: invalid or unsupported model file '%s'\n", __func__, model.c_str());
return false;
}
executable_path = inputs.executable_path;