Fix invalid read
This commit is contained in:
@@ -79,8 +79,10 @@ i32 _bzArrayIns(void *arr, i32 idx) {
|
||||
BZ_ASSERT(idx >= 0 && idx <= head->size);
|
||||
BZ_ASSERT(head->size + 1 <= head->capacity);
|
||||
|
||||
bzMemMove((u8 *) arr + (idx + 1) * head->stride,
|
||||
(u8 *) arr + idx * head->stride, head->stride);
|
||||
if (idx != head->size) {
|
||||
bzMemMove((u8 *) arr + (idx + 1) * head->stride,
|
||||
(u8 *) arr + idx * head->stride, head->stride);
|
||||
}
|
||||
head->size++;
|
||||
return idx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user