From cf4711bdf944f5a6d067352e071a476ba11579a0 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 16 Sep 2015 20:33:16 +0500 Subject: OpenSubdiv: Attempt to solve crash in background mode --- intern/opensubdiv/opensubdiv_capi.cc | 2 +- intern/opensubdiv/opensubdiv_utils_capi.cc | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'intern') diff --git a/intern/opensubdiv/opensubdiv_capi.cc b/intern/opensubdiv/opensubdiv_capi.cc index 11cf170365e..66598948daf 100644 --- a/intern/opensubdiv/opensubdiv_capi.cc +++ b/intern/opensubdiv/opensubdiv_capi.cc @@ -306,7 +306,7 @@ int openSubdiv_supportGPUDisplay(void) if (!vendor_checked) { vendor_checked = true; const char *vendor = (const char *)glGetString(GL_VENDOR); - if (strstr(vendor, "Intel")) { + if (vendor != NULL && strstr(vendor, "Intel")) { if(getenv("OPENSUBDIV_ALLOW_INTEL") == NULL) { is_intel = true; } diff --git a/intern/opensubdiv/opensubdiv_utils_capi.cc b/intern/opensubdiv/opensubdiv_utils_capi.cc index 8c5eefe2ba6..6bbe747634a 100644 --- a/intern/opensubdiv/opensubdiv_utils_capi.cc +++ b/intern/opensubdiv/opensubdiv_utils_capi.cc @@ -81,11 +81,13 @@ int openSubdiv_getAvailableEvaluators(void) vendor_checked = true; const char *vendor = (const char *)glGetString(GL_VENDOR); const char *renderer = (const char *)glGetString(GL_RENDERER); - if (strstr(vendor, "ATI") || - strstr(renderer, "Mesa DRI R") || - (strstr(renderer, "Gallium ") && strstr(renderer, " on ATI "))) - { - disable_glsl_compute = true; + if (vendor != NULL && renderer != NULL) { + if (strstr(vendor, "ATI") || + strstr(renderer, "Mesa DRI R") || + (strstr(renderer, "Gallium ") && strstr(renderer, " on ATI "))) + { + disable_glsl_compute = true; + } } } if (!disable_glsl_compute) { -- cgit v1.2.3