tag: xmp: Move static variable to local function
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>
Mon, 24 Jan 2011 18:21:10 +0000 (15:21 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Mon, 24 Jan 2011 18:21:10 +0000 (15:21 -0300)
Variable was being written to and could cause crashes
if multiple elements were parsing xmp at the same time.

Moving it to local scope solves the problem.

gst-libs/gst/tag/gstxmptag.c

index 758b977..2697f40 100644 (file)
@@ -957,15 +957,6 @@ struct _GstXmpNamespaceMap
   const gchar *original_ns;
   gchar *gstreamer_ns;
 };
-static GstXmpNamespaceMap ns_map[] = {
-  {"dc", NULL},
-  {"exif", NULL},
-  {"tiff", NULL},
-  {"xap", NULL},
-  {"photoshop", NULL},
-  {"Iptc4xmpCore", NULL},
-  {NULL, NULL}
-};
 
 /* parsing */
 
@@ -1153,6 +1144,16 @@ gst_tag_list_from_xmp_buffer (const GstBuffer * buffer)
   XmpTag *last_xmp_tag = NULL;
   GSList *pending_tags = NULL;
 
+  GstXmpNamespaceMap ns_map[] = {
+    {"dc", NULL},
+    {"exif", NULL},
+    {"tiff", NULL},
+    {"xap", NULL},
+    {"photoshop", NULL},
+    {"Iptc4xmpCore", NULL},
+    {NULL, NULL}
+  };
+
   xmp_tags_initialize ();
 
   g_return_val_if_fail (GST_IS_BUFFER (buffer), NULL);