Fix T38516: crash when using color picker from redo panel.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 6 Feb 2014 17:02:31 +0000 (18:02 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 6 Feb 2014 17:02:31 +0000 (18:02 +0100)
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_intern.h

index 6317cb83a3a2657db0de68d96270361ce6238cab..6121a1397615ea9f2dcb88d7f49a69d4e660fa21 100644 (file)
@@ -2299,7 +2299,7 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor
                 * would slow down redraw, so only lookup for actual transform when it's indeed
                 * needed
                 */
-               block->display_device = scn->display_settings.display_device;
+               BLI_strncpy(block->display_device, scn->display_settings.display_device, sizeof(block->display_device));
 
                /* copy to avoid crash when scene gets deleted with ui still open */
                block->unit = MEM_mallocN(sizeof(scn->unit), "UI UnitSettings");
index 379ddc2719755709d47b0bfd3dc914b03581a64f..4a0864e22e78f04fe8415bbbb93cb0b33ae9cfcf 100644 (file)
@@ -350,9 +350,9 @@ struct uiBlock {
 
        bool color_profile;         /* color profile for correcting linear colors for display */
 
-       const char *display_device; /* display device name used to display this block,
-                                    * used by color widgets to transform colors from/to scene linear
-                                    */
+       char display_device[64]; /* display device name used to display this block,
+                                 * used by color widgets to transform colors from/to scene linear
+                                 */
 };
 
 typedef struct uiSafetyRct {