Skip to content
Snippets Groups Projects
Commit 4f4005ac authored by Nagy Tibor's avatar Nagy Tibor
Browse files

sdl: Fix null pointer dereference

In some cases the SDL event loop could kick in before the window gets initialized.
parent 1cebcf5f
No related branches found
No related tags found
1 merge request!204sdl: Fix null pointer dereference
...@@ -380,7 +380,7 @@ diff -ruwN source/src/thread/pthread/SDL_systhread.c source-new/src/thread/pthre ...@@ -380,7 +380,7 @@ diff -ruwN source/src/thread/pthread/SDL_systhread.c source-new/src/thread/pthre
diff -ruwN source/src/video/orbital/SDL_orbitalevents.c source-new/src/video/orbital/SDL_orbitalevents.c diff -ruwN source/src/video/orbital/SDL_orbitalevents.c source-new/src/video/orbital/SDL_orbitalevents.c
--- source/src/video/orbital/SDL_orbitalevents.c 1969-12-31 17:00:00.000000000 -0700 --- source/src/video/orbital/SDL_orbitalevents.c 1969-12-31 17:00:00.000000000 -0700
+++ source-new/src/video/orbital/SDL_orbitalevents.c 2018-12-29 15:57:00.298520310 -0700 +++ source-new/src/video/orbital/SDL_orbitalevents.c 2018-12-29 15:57:00.298520310 -0700
@@ -0,0 +1,197 @@ @@ -0,0 +1,201 @@
+/* +/*
+ SDL - Simple DirectMedia Layer + SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga + Copyright (C) 1997-2012 Sam Lantinga
...@@ -425,6 +425,10 @@ diff -ruwN source/src/video/orbital/SDL_orbitalevents.c source-new/src/video/orb ...@@ -425,6 +425,10 @@ diff -ruwN source/src/video/orbital/SDL_orbitalevents.c source-new/src/video/orb
+{ +{
+ SDL_keysym keysym; + SDL_keysym keysym;
+ +
+ if (!this->hidden->window) {
+ return;
+ }
+
+ void* event_iter = orb_window_events(this->hidden->window); + void* event_iter = orb_window_events(this->hidden->window);
+ OrbEventOption oeo = orb_events_next(event_iter); + OrbEventOption oeo = orb_events_next(event_iter);
+ +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment