Fix T50122: SEGFAULT: OCIO configuration typo leads to segfault
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 6 Dec 2016 13:19:17 +0000 (14:19 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 6 Dec 2016 13:19:17 +0000 (14:19 +0100)
source/blender/imbuf/intern/colormanagement.c

index 01348549bc4a6574638248e71ea25278a40a97aa..a45346279d921193f81b1be459fd57294731ae38 100644 (file)
@@ -1227,7 +1227,12 @@ const char *IMB_colormanagement_get_float_colorspace(ImBuf *ibuf)
 
 const char *IMB_colormanagement_get_rect_colorspace(ImBuf *ibuf)
 {
-       return ibuf->rect_colorspace->name;
+       if (ibuf->rect_colorspace) {
+               return ibuf->rect_colorspace->name;
+       }
+       else {
+               return IMB_colormanagement_role_colorspace_name_get(COLOR_ROLE_DEFAULT_BYTE);
+       }
 }
 
 /*********************** Threaded display buffer transform routines *************************/