ggml : check for allocation failures to prevent crashes (#28149)

* ggml : check for allocation failures to prevent crashes

* wording
This commit is contained in:
Alexey Kopytko
2026-09-18 22:58:25 +09:00
committed by GitHub
parent 542348a35c
commit 5b335f413e
+4 -1
View File
@@ -4436,7 +4436,10 @@ bool clip_encode(struct clip_ctx * ctx, struct clip_encode_params * params) {
// build the inference graph
ggml_backend_sched_reset(ctx->sched.get());
ggml_cgraph * gf = clip_get_graph_builder(ctx, imgs, params)->build();
ggml_backend_sched_alloc_graph(ctx->sched.get(), gf);
if (!ggml_backend_sched_alloc_graph(ctx->sched.get(), gf)) {
LOG_ERR("%s: failed to allocate compute graph\n", __func__);
return false;
}
// set inputs
const auto & model = ctx->model;