[gimp/metadata-browser: 3/13] Bail out if the property value is faulty.



commit 37f5203748e606c6265c6e5f780e328fdfc6d82c
Author: Roman Joost <roman bromeco de>
Date:   Sun Sep 4 12:06:55 2011 +1000

    Bail out if the property value is faulty.
    
    This usually shouldn't happen, but if the value is corrupt, the
    metadata-browser shouldn't just crash.

 plug-ins/metadata/xmp-encode.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/plug-ins/metadata/xmp-encode.c b/plug-ins/metadata/xmp-encode.c
index 7d85171..29cb644 100644
--- a/plug-ins/metadata/xmp-encode.c
+++ b/plug-ins/metadata/xmp-encode.c
@@ -155,6 +155,11 @@ gen_property (GString            *buffer,
                               schema->prefix, property->name);
       for (i = 0; value_array[i] != NULL; i += 2)
         {
+         if (value_array[i+1] == NULL)
+          {
+            g_printerr("Bailing out:%s:%s", schema->prefix, property->name);
+            break;
+          }
           gen_element (buffer, 4,
                        "rdf", "li", value_array[i + 1],
                        "xml:lang", value_array[i],



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