diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c index 22065bc64..eb1a08d43 100644 --- a/glamor/glamor_core.c +++ b/glamor/glamor_core.c @@ -68,11 +68,14 @@ glamor_compile_glsl_prog(glamor_gl_dispatch * dispatch, GLenum type, dispatch->glGetShaderiv(prog, GL_INFO_LOG_LENGTH, &size); info = malloc(size); - - dispatch->glGetShaderInfoLog(prog, size, NULL, info); - ErrorF("Failed to compile %s: %s\n", - type == GL_FRAGMENT_SHADER ? "FS" : "VS", info); - ErrorF("Program source:\n%s", source); + if (info) { + dispatch->glGetShaderInfoLog(prog, size, NULL, info); + ErrorF("Failed to compile %s: %s\n", + type == GL_FRAGMENT_SHADER ? "FS" : "VS", info); + ErrorF("Program source:\n%s", source); + free(info); + } else + ErrorF("Failed to get shader compilation info.\n"); FatalError("GLSL compile failure\n"); } diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index 50b764b6a..13b7f44ec 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -500,6 +500,8 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) glamor_identify(0); glamor_egl = calloc(sizeof(*glamor_egl), 1); + if (glamor_egl == NULL) + return FALSE; if (xf86GlamorEGLPrivateIndex == -1) xf86GlamorEGLPrivateIndex = xf86AllocateScrnInfoPrivateIndex(); @@ -514,7 +516,7 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) } glamor_egl->display = eglGetDisplay(glamor_egl->gbm); #else - glamor_egl->display = eglGetDisplay((EGLNativeDisplayType)fd); + glamor_egl->display = eglGetDisplay((EGLNativeDisplayType)(intptr_t)fd); #endif glamor_egl->has_gem = glamor_egl_check_has_gem(fd);