basexmlformatter: Do not allow empty file loading
authorThibault Saunier <thibault.saunier@collabora.com>
Tue, 30 Apr 2013 17:26:57 +0000 (18:26 +0100)
committerThibault Saunier <thibault.saunier@collabora.com>
Tue, 30 Apr 2013 17:26:57 +0000 (18:26 +0100)
ges/ges-base-xml-formatter.c

index 94daeb1..12d2ff0 100644 (file)
@@ -142,6 +142,9 @@ create_parser_context (GESBaseXmlFormatter * self, const gchar * uri,
   if (!g_file_load_contents (file, NULL, &xmlcontent, &xmlsize, NULL, &err))
     goto failed;
 
+  if (g_strcmp0 (xmlcontent, "") == 0)
+    goto failed;
+
   parsecontext = g_markup_parse_context_new (&self_class->content_parser,
       G_MARKUP_TREAT_CDATA_AS_TEXT, self, NULL);