mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-19 17:24:57 +02:00
ggml : check for allocation failures to prevent crashes (#28149)
* ggml : check for allocation failures to prevent crashes * wording
This commit is contained in:
+4
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user