[gnome-color-manager] Fix up broken profiles found in the wild, so at least the text is displayable



commit 013abf97b6106ab4c9344113bbbf1eda689a7009
Author: Richard Hughes <richard hughsie com>
Date:   Fri Dec 4 17:40:21 2009 +0000

    Fix up broken profiles found in the wild, so at least the text is displayable

 src/gcm-profile.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-profile.c b/src/gcm-profile.c
index 09465f5..61e08d1 100644
--- a/src/gcm-profile.c
+++ b/src/gcm-profile.c
@@ -564,6 +564,20 @@ gcm_profile_parse_multi_localized_unicode (GcmProfile *profile, const gchar *dat
 		goto out;
 	}
 
+	/* correct broken profiles, seen in ISOuncoatedyellowish.icc : FIXME: why is the offset one off? */
+	ret = (memcmp (&data[offset+1], "text", 4) == 0);
+	if (ret) {
+		text = gcm_profile_parse_multi_localized_unicode (profile, data, offset+1);
+		goto out;
+	}
+
+	/* correct broken profiles, seen in ISOuncoatedyellowish.icc : FIXME: why is the offset one off? */
+	ret = (memcmp (&data[offset+1], "desc", 4) == 0);
+	if (ret) {
+		text = gcm_profile_parse_multi_localized_unicode (profile, data, offset+1);
+		goto out;
+	}
+
 	/* an unrecognised tag */
 	for (i=0x0; i<0x1c; i++) {
 		egg_warning ("unrecognised text tag");



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