[gthumb] PNG files not loaded from remote locations
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] PNG files not loaded from remote locations
- Date: Sun, 1 Mar 2020 20:18:56 +0000 (UTC)
commit dfc346d34dc8f95b3258ac2c08221fe1e83b0452
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sun Mar 1 20:48:35 2020 +0100
PNG files not loaded from remote locations
Make sure to read the requested amount of data.
Fixes https://gitlab.gnome.org/GNOME/gthumb/issues/81
extensions/cairo_io/cairo-image-surface-png.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/extensions/cairo_io/cairo-image-surface-png.c b/extensions/cairo_io/cairo-image-surface-png.c
index 8017ef68..e0ba3c53 100644
--- a/extensions/cairo_io/cairo-image-surface-png.c
+++ b/extensions/cairo_io/cairo-image-surface-png.c
@@ -84,16 +84,16 @@ cairo_png_read_data_func (png_structp png_ptr,
png_size_t size)
{
CairoPngData *cairo_png_data;
- gssize n;
GError *error = NULL;
cairo_png_data = png_get_io_ptr (png_ptr);
- n = g_input_stream_read (cairo_png_data->stream,
- buffer,
- size,
- cairo_png_data->cancellable,
- &error);
- if (n < 0) {
+ if(! g_input_stream_read_all (cairo_png_data->stream,
+ buffer,
+ size,
+ NULL,
+ cairo_png_data->cancellable,
+ &error))
+ {
png_error (png_ptr, error->message);
g_error_free (error);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]