From df534bb612be4bd8209b753f142d2e760551f6fb Mon Sep 17 00:00:00 2001 From: Clownacy Date: Mon, 6 Jan 2020 14:48:08 +0000 Subject: [PATCH] Fix SDLTexture backend's linked-list Was causing some use-after-free behaviour, according to valgrind. Should fix #87 --- src/Backends/Rendering/SDLTexture.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Backends/Rendering/SDLTexture.cpp b/src/Backends/Rendering/SDLTexture.cpp index 2979fedc..341e70b8 100644 --- a/src/Backends/Rendering/SDLTexture.cpp +++ b/src/Backends/Rendering/SDLTexture.cpp @@ -116,6 +116,9 @@ Backend_Surface* Backend_CreateSurface(unsigned int width, unsigned int height) surface->next = surface_list_head; surface_list_head = surface; + if (surface->next != NULL) + surface->next->prev = surface; + return surface; }