[libgsf] MSOLE: add sanity check.



commit ccf656df44e60314cf1eb09b8833f8d0a57d378a
Author: Morten Welinder <terra gnome org>
Date:   Wed Feb 20 15:30:24 2013 -0500

    MSOLE: add sanity check.

 ChangeLog             |    5 +++++
 gsf/gsf-msole-utils.c |   11 +++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4f8c4ce..2efb015 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-20  Morten Welinder  <terra gnome org>
+
+       * gsf/gsf-msole-utils.c (msole_metadata_write_section): Add sanity
+       check.
+
 2013-02-17  Morten Welinder  <terra gnome org>
 
        * configure.ac (set_more_warnings): Improve support for clang.
diff --git a/gsf/gsf-msole-utils.c b/gsf/gsf-msole-utils.c
index 7c9b7df..3aa535b 100644
--- a/gsf/gsf-msole-utils.c
+++ b/gsf/gsf-msole-utils.c
@@ -1626,6 +1626,17 @@ msole_metadata_write_section (WritePropState *state, gboolean user)
                }
        }
 
+       while (i < count) {
+               static gboolean warned = FALSE;
+               if (!warned) {
+                       warned = TRUE;
+                       g_warning ("Something strange in msole_metadata_write_section");
+               }
+               offsets[i].id = 0;
+               offsets[i].offset = offsets[i - 1].offset;
+               i++;
+       }
+
        len = gsf_output_tell (state->out) - base;
        gsf_output_seek (state->out, base, G_SEEK_SET);
        GSF_LE_SET_GUINT32 (buf, len);


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