Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-09-20 11:48:25 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-09-22 12:07:36 +0300
commitea7d500b6d4f290ab0892e966b56de6db7f9f3ca (patch)
treecaca1f113cc1dff8eb2a5516bb67b254a74b2a55 /source
parent0a97e632462c8d81e7cba3bc588f6ec029fa515c (diff)
Fix T49386: Blender crashes when told to load an OCIO LUT that does not exist
Diffstat (limited to 'source')
-rw-r--r--source/blender/imbuf/intern/colormanagement.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index 41812872f11..01348549bc4 100644
--- a/source/blender/imbuf/intern/colormanagement.c
+++ b/source/blender/imbuf/intern/colormanagement.c
@@ -3268,6 +3268,13 @@ bool IMB_colormanagement_setup_glsl_draw_from_space(const ColorManagedViewSettin
update_glsl_display_processor(applied_view_settings, display_settings,
from_colorspace ? from_colorspace->name : global_role_scene_linear);
+ if (global_glsl_state.processor == NULL) {
+ /* Happens when requesting non-existing color space or LUT in the
+ * configuration file does not exist.
+ */
+ return false;
+ }
+
return OCIO_setupGLSLDraw(&global_glsl_state.ocio_glsl_state, global_glsl_state.processor,
global_glsl_state.use_curve_mapping ? &global_glsl_state.curve_mapping_settings : NULL,
dither, predivide);
@@ -3304,5 +3311,7 @@ bool IMB_colormanagement_setup_glsl_draw_ctx(const bContext *C, float dither, bo
/* Finish GLSL-based display space conversion */
void IMB_colormanagement_finish_glsl_draw(void)
{
- OCIO_finishGLSLDraw(global_glsl_state.ocio_glsl_state);
+ if (global_glsl_state.ocio_glsl_state != NULL) {
+ OCIO_finishGLSLDraw(global_glsl_state.ocio_glsl_state);
+ }
}