diff options
author | Felix Riemann <friemann@svn.gnome.org> | 2008-12-14 22:25:15 +0000 |
---|---|---|
committer | Felix Riemann <friemann@src.gnome.org> | 2008-12-14 22:25:15 +0000 |
commit | 951c5abf2036bc6d87553a15cd5f11e4bcd521c3 (patch) | |
tree | 2a6c335a2d1e44ee86f179be0c0aea9b4304e739 | |
parent | 89f6fdead68e6ec0efeade71b797eb1b332d820e (diff) | |
download | eog-951c5abf2036bc6d87553a15cd5f11e4bcd521c3.tar.gz |
Don't use a pointer->uint32 conversion to check the chunk configuration.
2008-12-14 Felix Riemann <friemann@svn.gnome.org>
* src/eog-metadata-reader-png.c: (eog_metadata_reader_png_consume):
Don't use a pointer->uint32 conversion to check the chunk
configuration. Fixes SIGBUS crashes on SPARC systems.
Fixes bug #564526 (Friedrich Oslage).
svn path=/branches/gnome-2-24/; revision=4907
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/eog-metadata-reader-png.c | 7 |
2 files changed, 11 insertions, 3 deletions
@@ -1,3 +1,10 @@ +2008-12-14 Felix Riemann <friemann@svn.gnome.org> + + * src/eog-metadata-reader-png.c: (eog_metadata_reader_png_consume): + Don't use a pointer->uint32 conversion to check the chunk + configuration. Fixes SIGBUS crashes on SPARC systems. + Fixes bug #564526 (Friedrich Oslage). + 2008-12-13 Claudio Saavedra <csaavedra@igalia.com> * src/eog-image.c: (eog_image_real_load): Clean the input stream diff --git a/src/eog-metadata-reader-png.c b/src/eog-metadata-reader-png.c index 19b4b1cf..35d230d5 100644 --- a/src/eog-metadata-reader-png.c +++ b/src/eog-metadata-reader-png.c @@ -368,9 +368,10 @@ eog_metadata_reader_png_consume (EogMetadataReaderPng *emr, const guchar *buf, g if (priv->state == EMR_CHECK_CRC) { /* Check if it is actually an XMP chunk. - * Throw it away if not. */ - if ((memcmp (priv->xmp_chunk, "XML:com.adobe.xmp\0", 18) != 0) - || (*(guint32*)(priv->xmp_chunk+18)) != 0) { + * Throw it away if not. + * The check has 4 extra \0's to check + * if the chunk is configured correctly. */ + if (memcmp (priv->xmp_chunk, "XML:com.adobe.xmp\0\0\0\0\0", 22) != 0) { priv->state = EMR_SKIP_CRC; g_free (priv->xmp_chunk); priv->xmp_chunk = NULL; |