Commit dcfafdbe authored by Darin Adler's avatar Darin Adler

Fix some NULL dereferences.

	* rsvg-paint-server.c: (rsvg_paint_server_lin_grad_free),
	(rsvg_paint_server_rad_grad_free): Fix some NULL dereferences.

	* rsvg.c: (rsvg_handle_write), (rsvg_handle_close): Add FIXME
	to places that have half-hearted attempt at handling GError.
	(rsvg_pixbuf_from_file_at_zoom), (rsvg_pixbuf_from_file_at_size):
	Handle case where fopen fails (but not the GError part).
parent 8531bcae
2001-09-15 Darin Adler <darin@bentspoon.com>
* rsvg-paint-server.c: (rsvg_paint_server_lin_grad_free),
(rsvg_paint_server_rad_grad_free): Fix some NULL dereferences.
* rsvg.c: (rsvg_handle_write), (rsvg_handle_close): Add FIXME
to places that have half-hearted attempt at handling GError.
(rsvg_pixbuf_from_file_at_zoom), (rsvg_pixbuf_from_file_at_size):
Handle case where fopen fails (but not the GError part).
2001-09-10 Jonathan Blandford <jrb@redhat.com>
* librsvg-features.c:
......
......@@ -103,7 +103,8 @@ rsvg_paint_server_lin_grad_free (RsvgPaintServer *self)
{
RsvgPaintServerLinGrad *z = (RsvgPaintServerLinGrad *)self;
g_free (z->agl->stops);
if (z->agl)
g_free (z->agl->stops);
g_free (z->agl);
g_free (self);
}
......@@ -198,7 +199,8 @@ rsvg_paint_server_rad_grad_free (RsvgPaintServer *self)
{
RsvgPaintServerRadGrad *z = (RsvgPaintServerRadGrad *)self;
g_free (z->agr->stops);
if (z->agr)
g_free (z->agr->stops);
g_free (z->agr);
g_free (self);
}
......
......@@ -1485,6 +1485,7 @@ rsvg_handle_write (RsvgHandle *handle,
xmlParseChunk (handle->ctxt, buf, count, 0);
}
handle->error = NULL;
/* FIXME: Error handling not implemented. */
/* if (*real_error != NULL)
{
g_propagate_error (error, real_error);
......@@ -1514,6 +1515,7 @@ rsvg_handle_close (RsvgHandle *handle,
handle->error = &real_error;
xmlParseChunk (handle->ctxt, chars, 0, 1);
xmlFreeParserCtxt (handle->ctxt);
/* FIXME: Error handling not implemented. */
/*
if (real_error != NULL)
{
......@@ -1654,6 +1656,11 @@ rsvg_pixbuf_from_file_at_zoom (gchar *file_name,
g_return_val_if_fail (x_zoom > 0.0 && y_zoom > 0.0, NULL);
f = fopen (file_name, "r");
if (!f)
{
/* FIXME: Set up error. */
return NULL;
}
handle = rsvg_handle_new ();
data.zoom_set = TRUE;
......@@ -1700,6 +1707,11 @@ rsvg_pixbuf_from_file_at_size (gchar *file_name,
struct RsvgSizeCallbackData data;
f = fopen (file_name, "r");
if (!f)
{
/* FIXME: Set up error. */
return NULL;
}
handle = rsvg_handle_new ();
data.zoom_set = FALSE;
data.width = width;
......@@ -1717,5 +1729,3 @@ rsvg_pixbuf_from_file_at_size (gchar *file_name,
return retval;
}
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