summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Riemann <friemann@svn.gnome.org>2008-05-04 10:37:27 +0000
committerFelix Riemann <friemann@src.gnome.org>2008-05-04 10:37:27 +0000
commitfd414dcb929bf03dbfcce3566567fa59c4c05511 (patch)
tree5534e3a7fd84265ec4b7efab1bf6e0ffe0c9415e
parent6ab230b98b7ddfe0fdeab606bb7272d81133dc9c (diff)
downloadeog-fd414dcb929bf03dbfcce3566567fa59c4c05511.tar.gz
Don't let lcms abort EOG if it encounters an error while trying to load
2008-05-04 Felix Riemann <friemann@svn.gnome.org> * src/eog-window.c: (eog_window_get_display_profile): Don't let lcms abort EOG if it encounters an error while trying to load the display profile. Fixes bug #531300. svn path=/branches/gnome-2-22/; revision=4561
-rw-r--r--ChangeLog6
-rw-r--r--src/eog-window.c18
2 files changed, 24 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 480933ec..a9ba8dd5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-05-04 Felix Riemann <friemann@svn.gnome.org>
+
+ * src/eog-window.c: (eog_window_get_display_profile):
+ Don't let lcms abort EOG if it encounters an error while trying to
+ load the display profile. Fixes bug #531300.
+
2008-04-28 Felix Riemann <friemann@svn.gnome.org>
* data/eog.desktop.in.in: Remove unsupported "image/x-psd" file type.
diff --git a/src/eog-window.c b/src/eog-window.c
index 3f8b50bc..f95fd5c8 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -595,6 +595,7 @@ eog_window_get_display_profile (GdkScreen *screen)
int result;
cmsHPROFILE *profile;
char *atom_name;
+ int lcms_error_action;
dpy = GDK_DISPLAY_XDISPLAY (gdk_screen_get_display (screen));
@@ -640,7 +641,24 @@ eog_window_get_display_profile (GdkScreen *screen)
XFree (str);
return NULL;
}
+
+ /* Make lcms errors non-fatal here, as it is possible
+ * to load invalid profiles with XICC.
+ * We don't want lcms to abort EOG in that case.
+ */
+ lcms_error_action = cmsErrorAction (LCMS_ERROR_IGNORE);
+
profile = cmsOpenProfileFromMem (str, length);
+
+ // Restore the previous error setting
+ cmsErrorAction (lcms_error_action);
+
+ if (G_UNLIKELY (profile == NULL)) {
+ eog_debug_message (DEBUG_LCMS,
+ "Invalid display profile, "
+ "not correcting");
+ }
+
XFree (str);
} else {
profile = NULL;