diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-08-11 07:17:55 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-08-11 07:29:56 -0400 |
commit | 7900032f3067166502978413ed2447c68dc83771 (patch) | |
tree | efefbc9db31c86ef1214c64cc7cd43fd70cfd02c /gtk | |
parent | a020cf7534ea51c56527777ba1524da82e89f406 (diff) | |
download | gtk+-7900032f3067166502978413ed2447c68dc83771.tar.gz |
css: Propagate charset conversion errors
Lets not throw away informtation that
helps to figure out why things fail.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/css/gtkcssdataurl.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gtk/css/gtkcssdataurl.c b/gtk/css/gtkcssdataurl.c index 6645b4835d..cc430378f2 100644 --- a/gtk/css/gtkcssdataurl.c +++ b/gtk/css/gtkcssdataurl.c @@ -152,13 +152,23 @@ gtk_css_data_url_parse (const char *url, gsize read; gsize written; gpointer data; + GError *local_error = NULL; data = g_convert_with_fallback (bdata, bsize, "UTF-8", charset, (char *) "*", - &read, &written, NULL); + &read, &written, &local_error); g_free (bdata); + if (local_error) + { + g_propagate_error (error, local_error); + g_free (charset); + g_free (data); + return NULL; + } + + bdata = data; bsize = written; } |