eog r4560 - in trunk: . src



Author: friemann
Date: Sun May  4 10:35:58 2008
New Revision: 4560
URL: http://svn.gnome.org/viewvc/eog?rev=4560&view=rev

Log:
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.


Modified:
   trunk/ChangeLog
   trunk/src/eog-window.c

Modified: trunk/src/eog-window.c
==============================================================================
--- trunk/src/eog-window.c	(original)
+++ trunk/src/eog-window.c	Sun May  4 10:35:58 2008
@@ -589,6 +589,7 @@
 	int result;
 	cmsHPROFILE *profile;
 	char *atom_name;
+	int lcms_error_action;
 	
 	dpy = GDK_DISPLAY_XDISPLAY (gdk_screen_get_display (screen));
 
@@ -634,7 +635,24 @@
 				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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]