diff options
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/colormanagement.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index 50495d39252..11dce3087c6 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -1042,12 +1042,14 @@ const char *IMB_colormanagement_role_colorspace_name_get(int role) void IMB_colormanagement_assign_rect_colorspace(ImBuf *ibuf, const char *name) { ColorSpace *colorspace = colormanage_colorspace_get_named(name); - ibuf->rect_colorspace = colorspace; + if (colorspace) { + ibuf->rect_colorspace = colorspace; - if (colorspace->is_data) - ibuf->colormanage_flag |= IMB_COLORMANAGE_IS_DATA; - else - ibuf->colormanage_flag &= ~IMB_COLORMANAGE_IS_DATA; + if (colorspace->is_data) + ibuf->colormanage_flag |= IMB_COLORMANAGE_IS_DATA; + else + ibuf->colormanage_flag &= ~IMB_COLORMANAGE_IS_DATA; + } } /*********************** Threaded display buffer transform routines *************************/ |