Hi Pelle,
I am out of my depth here but I thought I'd run this by you anyway.
An associate was using stb_image (a png library) and it appeared to work okay for sizes up to 800x800 ... anything larger would crash the app.
The library used a VLA for the bitmap data.
I read your earlier explanation that you use _alloca() to implement VLA allocation and your desire to rework things in the future.
I decided to use the _alloca() directly, instead of relying on VLA on my friends code I got exactly the same results.
Next I decided to use malloc() instead of _alloca() and the bug and crash went away.
The application compiled with LccWin32 behaved exactly the same ways as with Pelles before and after my fix.
The app compiled with Mingw32 performed correctly using VLA, so it didn't need the fix.
This all leads me to think you and Jacob are using similar approaches to VLA implementation and perhaps your _alloca() functions are flawed.
I don't have access to your sources, so this is all speculation on my part.
Do whatever you want to with this information.
Peace!
MrBcx