aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ggml.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ggml.c b/ggml.c
index 8cc4834..5b5ed92 100644
--- a/ggml.c
+++ b/ggml.c
@@ -4411,7 +4411,7 @@ void ggml_free(struct ggml_context * ctx) {
}
size_t ggml_used_mem(const struct ggml_context * ctx) {
- return ctx->objects_end->offs + ctx->objects_end->size;
+ return ctx->objects_end == NULL ? 0 : ctx->objects_end->offs + ctx->objects_end->size;
}
size_t ggml_set_scratch(struct ggml_context * ctx, struct ggml_scratch scratch) {