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
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-09-18 14:11:46 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-09-18 14:11:46 +0400
commit3d9d7275b58ff3ca6215236ff580a2bdb6b65264 (patch)
tree58cc3ed48fd8e09951640db8f980dd8d3608a949 /source/blender
parentc50c654543b5928d29cc841d1bffb709332f9c6c (diff)
Color Management: fixed crash when changing display device in screenshot save operator
In fact, color management settings shouldn't be editing from this operator since screenshot is using OpenGL which is in sRGB space, but fixed issues with Image Format initialization and added NULL pointer checks.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/image.c3
-rw-r--r--source/blender/editors/screen/screendump.c2
-rw-r--r--source/blender/makesrna/intern/rna_color.c6
3 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 208f5ea89e3..8fb5f00dee2 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1227,6 +1227,9 @@ void BKE_imformat_defaults(ImageFormatData *im_format)
im_format->imtype = R_IMF_IMTYPE_PNG;
im_format->quality = 90;
im_format->compress = 90;
+
+ BKE_color_managed_display_settings_init(&im_format->display_settings);
+ BKE_color_managed_view_settings_init(&im_format->view_settings);
}
void BKE_imbuf_to_image_format(struct ImageFormatData *im_format, const ImBuf *imbuf)
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 301df719142..aeae79aa9d0 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -245,7 +245,7 @@ static void screenshot_draw(bContext *UNUSED(C), wmOperator *op)
/* image template */
RNA_pointer_create(NULL, &RNA_ImageFormatSettings, &scd->im_format, &ptr);
- uiTemplateImageSettings(layout, &ptr, TRUE);
+ uiTemplateImageSettings(layout, &ptr, FALSE);
/* main draw call */
RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index 0edcad59577..e7b09506ab4 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -377,6 +377,9 @@ static void rna_ColorManagedDisplaySettings_display_device_update(Main *UNUSED(b
{
ID *id = ptr->id.data;
+ if (!id)
+ return;
+
if (GS(id->name) == ID_SCE) {
Scene *scene = (Scene *) id;
@@ -486,6 +489,9 @@ static void rna_ColorManagement_update(Main *UNUSED(bmain), Scene *UNUSED(scene)
{
ID *id = ptr->id.data;
+ if (!id)
+ return;
+
if (GS(id->name) == ID_SCE) {
WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL);
}