mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-12 19:50:17 +00:00
ggml : fix bounds checking of zero size views (#6347)
This commit is contained in:
parent
3a0345970e
commit
e5b89a441a
2
ggml.c
2
ggml.c
@ -2938,7 +2938,7 @@ static struct ggml_tensor * ggml_new_tensor_impl(
|
|||||||
data_size *= ne[i];
|
data_size *= ne[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
GGML_ASSERT(view_src == NULL || data_size + view_offs <= ggml_nbytes(view_src));
|
GGML_ASSERT(view_src == NULL || data_size == 0 || data_size + view_offs <= ggml_nbytes(view_src));
|
||||||
|
|
||||||
void * data = view_src != NULL ? view_src->data : NULL;
|
void * data = view_src != NULL ? view_src->data : NULL;
|
||||||
if (data != NULL) {
|
if (data != NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user