diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c
index 81b1314e077245dd8cd95e185c748dbcab7dbd52..9b6678401563da10dc423b77ad1fb00b42f257e4 100644
--- a/src/sdl/ogl_sdl.c
+++ b/src/sdl/ogl_sdl.c
@@ -155,6 +155,7 @@ boolean OglSdlSurface(INT32 w, INT32 h)
 {
 	INT32 cbpp = cv_scr_depth.value < 16 ? 16 : cv_scr_depth.value;
 	static boolean first_init = false;
+	static int majorGL = 0, minorGL = 0;
 
 	oglflags = 0;
 
@@ -189,7 +190,8 @@ boolean OglSdlSurface(INT32 w, INT32 h)
 	else
 		maximumAnisotropy = 1;
 
-	if (atof((const char*)gl_version) >= 1.4)
+	if (sscanf((const char*)gl_version, "%d.%d", &majorGL, &minorGL)
+		&& (!(majorGL == 1 && minorGL <= 3)))
 		supportMipMap = true;
 	else
 		supportMipMap = false;