[gnome-color-manager] Add another fix for squiffy profiles that don't align to 4-byte intervals, but work non-the-less



commit 5bce2baa447e626c7549b84f0d0331024b3a29ae
Author: Richard Hughes <richard hughsie com>
Date:   Thu Dec 10 10:02:36 2009 +0000

    Add another fix for squiffy profiles that don't align to 4-byte intervals, but work non-the-less

 src/gcm-profile.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/gcm-profile.c b/src/gcm-profile.c
index df8789f..6a96277 100644
--- a/src/gcm-profile.c
+++ b/src/gcm-profile.c
@@ -873,11 +873,19 @@ gcm_profile_fix_offset (const gchar *data, guint tag_offset)
 		goto out;
 	}
 
+	/* offset seems to be valid after all */
+	ret = gcm_parser_is_tag (data + tag_offset);
+	if (ret) {
+		fixed_offset = tag_offset;
+		egg_debug ("tag_offset is %02x which is not on a 4-byte boundary, but it seems to be valid", tag_offset);
+		goto out;
+	}
+
 	/* bytestream is one byte offset */
 	ret = gcm_parser_is_tag (data + tag_offset + 1);
 	if (ret) {
 		fixed_offset = tag_offset + 1;
-		egg_debug ("tag_offset is %i which is not on a 4-byte boundary, correcting by 1 byte", tag_offset);
+		egg_debug ("tag_offset is %02x which is not on a 4-byte boundary, correcting by 1 byte", tag_offset);
 		goto out;
 	}
 
@@ -885,7 +893,7 @@ gcm_profile_fix_offset (const gchar *data, guint tag_offset)
 	ret = gcm_parser_is_tag (data + tag_offset + offset_padding_error);
 	if (ret) {
 		fixed_offset = tag_offset + offset_padding_error;
-		egg_debug ("tag_offset is %i which is not on a 4-byte boundary, correcting by %i bytes", tag_offset, offset_padding_error);
+		egg_debug ("tag_offset is %02x which is not on a 4-byte boundary, correcting by %i bytes", tag_offset, offset_padding_error);
 		goto out;
 	}
 



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