SDL2: fix NULL pointer dereference.

This commit is contained in:
Adrien Destugues
2014-09-03 19:26:31 +02:00
parent 5e3575b4f4
commit eb2e52395e

View File

@@ -1,11 +1,11 @@
From 93052ac5a195d2c3631ca454630766c6d0ea6f74 Mon Sep 17 00:00:00 2001
From d6e2e7b054e8aff4979dc762b33236c4391587b0 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 29 Aug 2014 15:24:11 +0000
Subject: haiku patch
diff --git a/configure.in b/configure.in
index 3d8a2de..c556a55 100644
index 3d8a2de..aab5ced 100644
--- a/configure.in
+++ b/configure.in
@@ -276,7 +276,7 @@ if test x$enable_libc = xyes; then
@@ -125,3 +125,27 @@ index 245cec1..52ee67a 100644
--
1.8.3.4
From 10d5f202f16294da23c5752d9a2d9d1ea238cde3 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Wed, 3 Sep 2014 19:22:12 +0200
Subject: Fix null pointer dereference.
diff --git a/src/video/haiku/SDL_bopengl.cc b/src/video/haiku/SDL_bopengl.cc
index 52ee67a..2f0073d 100644
--- a/src/video/haiku/SDL_bopengl.cc
+++ b/src/video/haiku/SDL_bopengl.cc
@@ -93,7 +93,8 @@ void BE_GL_SwapWindow(_THIS, SDL_Window * window) {
}
int BE_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) {
- _GetBeApp()->SetCurrentContext(((SDL_BWin*)context)->GetGLView());
+ SDL_BWin* win = (SDL_BWin*)context;
+ _GetBeApp()->SetCurrentContext(win ? win->GetGLView() : NULL);
return 0;
}
--
1.8.3.4