diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-09-16 18:33:16 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-09-16 18:33:16 +0300 |
commit | cf4711bdf944f5a6d067352e071a476ba11579a0 (patch) | |
tree | f092e4bd3e0a4884f25b0f8e6a7539009ab9716e /intern | |
parent | 0f19e6d1a70b985603a49ad2b7cd2c9b98365ce9 (diff) |
OpenSubdiv: Attempt to solve crash in background mode
Diffstat (limited to 'intern')
-rw-r--r-- | intern/opensubdiv/opensubdiv_capi.cc | 2 | ||||
-rw-r--r-- | intern/opensubdiv/opensubdiv_utils_capi.cc | 12 |
2 files changed, 8 insertions, 6 deletions
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) { |