Commit 33742823 authored by Darin Adler's avatar Darin Adler

Change so it can handle a NULL for the content passed in. Happens at least

	* rsvg.c: (rsvg_entity_decl): Change so it can handle a NULL
	for the content passed in. Happens at least if the .svg file
	is empty and presumably in other cases.
	(rsvg_handle_free): Handle case where pixbuf is NULL.
	* test-rsvg.c: (main): Don't write anything out if a NULL
	pixbuf is returned. This can happen if the .svg file is
	empty.
parent 14ae4e41
2001-09-24 Darin Adler <darin@bentspoon.com>
* rsvg.c: (rsvg_entity_decl): Change so it can handle a NULL
for the content passed in. Happens at least if the .svg file
is empty and presumably in other cases.
(rsvg_handle_free): Handle case where pixbuf is NULL.
* test-rsvg.c: (main): Don't write anything out if a NULL
pixbuf is returned. This can happen if the .svg file is
empty.
2001-09-24 Darin Adler <darin@bentspoon.com>
* librsvg-2.0.pc.in: Update to point to libart 2.
......
......@@ -1313,16 +1313,18 @@ rsvg_entity_decl (void *data, const xmlChar *name, int type,
xmlEntityPtr entity;
char *dupname;
entity = g_new (xmlEntity, 1);
entity = g_new0 (xmlEntity, 1);
entity->type = type;
entity->length = strlen (name);
dupname = g_strdup (name);
entity->name = dupname;
entity->ExternalID = g_strdup (publicId);
entity->SystemID = g_strdup (systemId);
entity->content = xmlMemStrdup (content);
entity->length = strlen (content);
entity->orig = NULL;
if (content)
{
entity->content = xmlMemStrdup (content);
entity->length = strlen (content);
}
g_hash_table_insert (entities, dupname, entity);
}
......@@ -1556,7 +1558,8 @@ rsvg_handle_free (RsvgHandle *handle)
if (handle->user_data_destroy)
(* handle->user_data_destroy) (handle->user_data);
g_object_unref (handle->pixbuf);
if (handle->pixbuf)
g_object_unref (handle->pixbuf);
g_free (handle);
}
......
......@@ -59,6 +59,7 @@ main (int argc, char **argv)
atof (x_zoom_str),
atof (y_zoom_str),
NULL);
gdk_pixbuf_save (pixbuf, args[1], "png", NULL, NULL);
if (pixbuf)
gdk_pixbuf_save (pixbuf, args[1], "png", NULL, NULL);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment