diff options
author | Bastien Nocera <hadess@hadess.net> | 2016-12-12 17:19:45 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2016-12-12 17:58:32 +0100 |
commit | de8b5678291eb27a9370631c6dd3d15eded6bdfc (patch) | |
tree | 56dd7c8503bf3ae2ac5ad9af0915c3ee226dbd13 /thumbnailer | |
parent | e5ab88653c5cce9bf284f3588ddfd75fa2dab32b (diff) | |
download | gdk-pixbuf-de8b5678291eb27a9370631c6dd3d15eded6bdfc.tar.gz |
thumbnailer: Avoid double-setting errors
When the image loading failed already, don't capture the error from
gdk_pixbuf_loader_close() to avoid a run-time warning.
Diffstat (limited to 'thumbnailer')
-rw-r--r-- | thumbnailer/gdk-pixbuf-thumbnailer.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/thumbnailer/gdk-pixbuf-thumbnailer.c b/thumbnailer/gdk-pixbuf-thumbnailer.c index a43fa5815..bd07d5e16 100644 --- a/thumbnailer/gdk-pixbuf-thumbnailer.c +++ b/thumbnailer/gdk-pixbuf-thumbnailer.c @@ -186,6 +186,9 @@ _gdk_pixbuf_new_from_uri_at_scale (const char *uri, /* This can happen if the above loop was exited due to the * g_input_stream_read() call failing. */ result = FALSE; + } else if (*error != NULL) { + gdk_pixbuf_loader_close (loader, NULL); + result = FALSE; } else if (gdk_pixbuf_loader_close (loader, error) == FALSE) { if (!g_error_matches (*error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION)) result = FALSE; @@ -231,11 +234,8 @@ file_to_pixbuf (const char *path, file = g_file_new_for_path (path); uri = g_file_get_uri (file); pixbuf = _gdk_pixbuf_new_from_uri_at_scale (uri, destination_size, error); - if (pixbuf == NULL) { - g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, - "Generic error"); - return pixbuf; - } + if (pixbuf == NULL) + return NULL; tmp_pixbuf = gdk_pixbuf_apply_embedded_orientation (pixbuf); gdk_pixbuf_copy_options (pixbuf, tmp_pixbuf); |