Fix another vulnerable spot for crashes.

Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
Adam Treat 2024-02-26 09:04:14 -05:00 committed by AT
parent 17a2cdbe35
commit f720261d46

View File

@ -122,6 +122,8 @@ static gguf_context *load_gguf(const char *fname) {
static int32_t get_arch_key_u32(std::string const &modelPath, std::string const &archKey) {
auto * ctx = load_gguf(modelPath.c_str());
if (!ctx)
return -1;
auto arch = get_arch_name(ctx);
int32_t value = -1;