Skip to content

Commit 816ae3e

Browse files
slarenhodlen
authored andcommitted
ggml : fix bounds checking of zero size views (ggml-org#6347)
1 parent 701abc4 commit 816ae3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ggml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2938,7 +2938,7 @@ static struct ggml_tensor * ggml_new_tensor_impl(
29382938
data_size *= ne[i];
29392939
}
29402940

2941-
GGML_ASSERT(view_src == NULL || data_size + view_offs <= ggml_nbytes(view_src));
2941+
GGML_ASSERT(view_src == NULL || data_size == 0 || data_size + view_offs <= ggml_nbytes(view_src));
29422942

29432943
void * data = view_src != NULL ? view_src->data : NULL;
29442944
if (data != NULL) {

0 commit comments

Comments
 (0)