shithub: npe

Download patch

ref: f064e835258eccea9b509d3888b1dd72fb1e1961
parent: cb0be8727657184bc7e3f61125eddef7024b8f38
author: qwx <qwx@sciops.net>
date: Mon Mar 2 19:13:11 EST 2026

sdl2: SDL_GetMouseState: guard against usage prior to initdraw call

--- a/libnpe_sdl2/sdl2.c
+++ b/libnpe_sdl2/sdl2.c
@@ -1000,6 +1000,8 @@
 {
 	Uint32 b;
 
+	if(screen == nil)
+		return 0;
 	b = SDL_GetGlobalMouseState(nil, nil);
 	if(x != nil)
 		*x = npe_sdl.m.xy.x - screen->r.min.x;
--