From 6461678967840ce66894cb081f1b7c8b0fc9309b Mon Sep 17 00:00:00 2001 From: Eidolon Date: Thu, 13 Feb 2025 04:18:43 +0000 Subject: [PATCH] Merge branch 'bheapPushWrongRealloc' into 'master' Fix wrong size in K_BHeapPush Z_Realloc See merge request KartKrew/RingRacers!83 --- src/k_bheap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_bheap.c b/src/k_bheap.c index ae74c97b0..3109a8dc9 100644 --- a/src/k_bheap.c +++ b/src/k_bheap.c @@ -394,7 +394,7 @@ boolean K_BHeapPush(bheap_t *const heap, void *const item, UINT32 value, updatei if (heap->count >= heap->capacity) { size_t newarraycapacity = heap->capacity * 2; - heap->array = Z_Realloc(heap->array, newarraycapacity, PU_STATIC, NULL); + heap->array = Z_Realloc(heap->array, newarraycapacity * sizeof(bheapitem_t), PU_STATIC, NULL); if (heap->array == NULL) {