From 9c7e5201db186816141e0a60f6c5c5aec5d630e5 Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Wed, 27 Nov 2013 19:36:42 +0100 Subject: [PATCH] Fixed entry point validity check --- Source/OpenTK/Platform/Windows/WinGLContext.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/OpenTK/Platform/Windows/WinGLContext.cs b/Source/OpenTK/Platform/Windows/WinGLContext.cs index 73b0eca3..860f4cad 100644 --- a/Source/OpenTK/Platform/Windows/WinGLContext.cs +++ b/Source/OpenTK/Platform/Windows/WinGLContext.cs @@ -348,12 +348,10 @@ namespace OpenTK.Platform.Windows static bool IsValid(IntPtr address) { - unsafe - { - // See https://www.opengl.org/wiki/Load_OpenGL_Functions - void* a = address.ToPointer(); - return a < (void*)-1 || a > (void*)3; - } + // See https://www.opengl.org/wiki/Load_OpenGL_Functions + long a = address.ToInt64(); + bool is_valid = (a < -1 )|| (a > 3); + return is_valid; } #endregion