From eed9c479dded7f8198074f65d192a3c4ad6697c3 Mon Sep 17 00:00:00 2001 From: 32th-System Date: Sat, 6 Dec 2025 15:18:06 +0100 Subject: [PATCH] Windows: fix crash when rendering video Becuase stdlib.h was included, malloc was not declared anywhere. In C, using an undeclared function makes the compiler pretend that it's declared and has a signature of int func(); meaning that the return value is a 32 bit int and the parameters can be whatever. As a result of this, after the malloc call, the compiler would insert an instruction to sign extend the lower 32 bits of the RAX register into the upper 32 bits, which would of course create a pointer that is invalid in a lot of cases --- src/ffmpeg_windows.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ffmpeg_windows.c b/src/ffmpeg_windows.c index 53e4f9c..4c605df 100644 --- a/src/ffmpeg_windows.c +++ b/src/ffmpeg_windows.c @@ -2,6 +2,7 @@ #include #include #include +#include #define WIN32_LEAN_AND_MEAN #define _WINUSER_