From 9c2e4f52e6d4894d88f5a130d1e02d31ec4c6221 Mon Sep 17 00:00:00 2001 From: Brick <6098371+0x1F9F1@users.noreply.github.com> Date: Wed, 3 Apr 2024 21:25:04 +0100 Subject: [PATCH] Fixed misuse of entry->size in SDL_TrackAllocation entry->size is the size of the allocation, not the number of stack frames --- src/test/SDL_test_memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/SDL_test_memory.c b/src/test/SDL_test_memory.c index b9a1e9efe..ca5ff6203 100644 --- a/src/test/SDL_test_memory.c +++ b/src/test/SDL_test_memory.c @@ -161,8 +161,8 @@ static void SDL_TrackAllocation(void *mem, size_t size) count = CaptureStackBackTrace(1, SDL_arraysize(frames), frames, NULL); - entry->size = SDL_min(count, MAXIMUM_TRACKED_STACK_DEPTH); - for (i = 0; i < entry->size; i++) { + count = SDL_min(count, MAXIMUM_TRACKED_STACK_DEPTH); + for (i = 0; i < count; i++) { char symbol_buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR)]; PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)symbol_buffer; DWORD64 dwDisplacement = 0;