Revision: 60038
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60038
Author:   lukastoenne
Date:     2013-09-11 09:02:59 +0000 (Wed, 11 Sep 2013)
Log Message:
-----------
Revert r60034 and proper fix for #36698 by Sergey Sharybin. NULL pointer checks 
should never be done in color management. Instead this makes sure the look 
identifier is always initialized correctly to
the default if not defined.

Revision Links:
--------------
    
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60034

Modified Paths:
--------------
    trunk/blender/source/blender/imbuf/intern/colormanagement.c

Modified: trunk/blender/source/blender/imbuf/intern/colormanagement.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/colormanagement.c 2013-09-11 
07:36:40 UTC (rev 60037)
+++ trunk/blender/source/blender/imbuf/intern/colormanagement.c 2013-09-11 
09:02:59 UTC (rev 60038)
@@ -750,7 +750,7 @@
        OCIO_displayTransformSetView(dt, view_transform);
        OCIO_displayTransformSetDisplay(dt, display);
 
-       if (look_descr && look_descr->is_noop == false) {
+       if (look_descr->is_noop == false) {
                OCIO_displayTransformSetLooksOverrideEnabled(dt, true);
                OCIO_displayTransformSetLooksOverride(dt, look);
        }
@@ -989,6 +989,7 @@
 {
        ColorManagedDisplay *display;
        ColorManagedView *default_view = NULL;
+       ColorManagedLook *default_look = (ColorManagedLook *) 
global_looks.first;
 
        if (view_settings->view_transform[0] == '\0') {
                display = 
colormanage_display_get_named(display_settings->display_device);
@@ -1001,7 +1002,6 @@
        }
        else {
                ColorManagedView *view = 
colormanage_view_get_named(view_settings->view_transform);
-               ColorManagedLook *look;
 
                if (!view) {
                        display = 
colormanage_display_get_named(display_settings->display_device);
@@ -1016,17 +1016,17 @@
                                BLI_strncpy(view_settings->view_transform, 
default_view->name, sizeof(view_settings->view_transform));
                        }
                }
+       }
 
-               look = colormanage_look_get_named(view_settings->look);
-               if (!look) {
-                       ColorManagedLook *default_look = (ColorManagedLook *) 
global_looks.first;
+       if (view_settings->look[0] == '\0') {
+               BLI_strncpy(view_settings->look, default_look->name, 
sizeof(view_settings->look));
+       }
+       else {
+               ColorManagedLook *look = 
colormanage_look_get_named(view_settings->look);
+               if (look == NULL) {
+                       printf("Color management: %s look \"%s\" not found, 
setting default \"%s\".\n",
+                              what, view_settings->look, default_look->name);
 
-                       /* Prevent paranoid printf when opening files stored 
prior looks implementation. */
-                       if (view_settings->look[0]) {
-                               printf("Color management: %s look \"%s\" not 
found, setting default \"%s\".\n",
-                                      what, view_settings->look, 
default_look->name);
-                       }
-
                        BLI_strncpy(view_settings->look, default_look->name, 
sizeof(view_settings->look));
                }
        }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to