[librsvg/no-mime-type] Pass required out parameter
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/no-mime-type] Pass required out parameter
- Date: Sun, 18 Nov 2018 17:33:26 +0000 (UTC)
commit 6227e50743a36ff0002c7df49686aea5b9391228
Author: Emmanuele Bassi <ebassi gnome org>
Date: Sun Nov 18 17:15:22 2018 +0000
Pass required out parameter
After commit d9464d20108ee6adb322cfa12fd849d637e5d783,
rsvg_decode_data_uri() requires a non-nullable `mime_type` out argument,
instead of allowing it to be NULL.
This means that all callers on the C side need to pass a `mime_type`
argument, even if they will ignore it.
librsvg/rsvg-handle.c | 4 +++-
librsvg/rsvg-load.c | 6 +++++-
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/librsvg/rsvg-handle.c b/librsvg/rsvg-handle.c
index ecdffdfb..a3c4e263 100644
--- a/librsvg/rsvg-handle.c
+++ b/librsvg/rsvg-handle.c
@@ -481,6 +481,7 @@ RsvgHandle *
rsvg_handle_new_from_file (const gchar *file_name, GError **error)
{
gchar *base_uri;
+ gchar *mime_type;
char *data;
gsize data_len;
RsvgHandle *handle = NULL;
@@ -507,7 +508,7 @@ rsvg_handle_new_from_file (const gchar *file_name, GError **error)
return NULL;
}
- data = _rsvg_io_acquire_data (base_uri, base_uri, NULL, &data_len, NULL, error);
+ data = _rsvg_io_acquire_data (base_uri, base_uri, &mime_type, &data_len, NULL, error);
if (data) {
handle = rsvg_handle_new ();
@@ -519,6 +520,7 @@ rsvg_handle_new_from_file (const gchar *file_name, GError **error)
g_free (data);
}
+ g_free (mime_type);
g_free (base_uri);
g_object_unref (file);
diff --git a/librsvg/rsvg-load.c b/librsvg/rsvg-load.c
index 6dc1602d..127bc4b7 100644
--- a/librsvg/rsvg-load.c
+++ b/librsvg/rsvg-load.c
@@ -269,10 +269,14 @@ rsvg_load_handle_xml_xinclude (RsvgHandle *handle, const char *url)
GInputStream *stream;
GError *err = NULL;
xmlParserCtxtPtr xml_parser;
+ gchar *mime_type;
g_assert (handle->priv->load != NULL);
- stream = _rsvg_handle_acquire_stream (handle, url, NULL, NULL);
+ stream = _rsvg_handle_acquire_stream (handle, url, &mime_type, NULL);
+
+ g_free (mime_type);
+
if (stream) {
xml_parser = create_xml_stream_parser (handle->priv->load,
stream,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]