|
|
b83518 |
--- evince-3.28.2/backend/comics/comics-document.c
|
|
|
b83518 |
+++ evince-3.28.2/backend/comics/comics-document.c
|
|
|
b83518 |
@@ -453,23 +453,27 @@ comics_document_render_pixbuf (EvDocumen
|
|
|
b83518 |
|
|
|
b83518 |
name = ev_archive_get_entry_pathname (comics_document->archive);
|
|
|
b83518 |
if (g_strcmp0 (name, page_path) == 0) {
|
|
|
b83518 |
- size_t size = ev_archive_get_entry_size (comics_document->archive);
|
|
|
b83518 |
+ gint64 size = ev_archive_get_entry_size (comics_document->archive);
|
|
|
b83518 |
char *buf;
|
|
|
b83518 |
ssize_t read;
|
|
|
b83518 |
|
|
|
b83518 |
- buf = g_malloc (size);
|
|
|
b83518 |
- read = ev_archive_read_data (comics_document->archive, buf, size, &error);
|
|
|
b83518 |
- if (read <= 0) {
|
|
|
b83518 |
- if (read < 0) {
|
|
|
b83518 |
- g_warning ("Fatal error reading '%s' in archive: %s", name, error->message);
|
|
|
b83518 |
- g_error_free (error);
|
|
|
b83518 |
+ if (size >= 0) {
|
|
|
b83518 |
+ buf = g_malloc (size);
|
|
|
b83518 |
+ read = ev_archive_read_data (comics_document->archive, buf, size, &error);
|
|
|
b83518 |
+ if (read <= 0) {
|
|
|
b83518 |
+ if (read < 0) {
|
|
|
b83518 |
+ g_warning ("Fatal error reading '%s' in archive: %s", name, error->message);
|
|
|
b83518 |
+ g_error_free (error);
|
|
|
b83518 |
+ } else {
|
|
|
b83518 |
+ g_warning ("Read an empty file from the archive");
|
|
|
b83518 |
+ }
|
|
|
b83518 |
} else {
|
|
|
b83518 |
- g_warning ("Read an empty file from the archive");
|
|
|
b83518 |
+ gdk_pixbuf_loader_write (loader, (guchar *) buf, size, NULL);
|
|
|
b83518 |
}
|
|
|
b83518 |
+ g_free (buf);
|
|
|
b83518 |
} else {
|
|
|
b83518 |
- gdk_pixbuf_loader_write (loader, (guchar *) buf, size, NULL);
|
|
|
b83518 |
+ g_warning ("Fatal error reading '%s' in archive", name);
|
|
|
b83518 |
}
|
|
|
b83518 |
- g_free (buf);
|
|
|
b83518 |
gdk_pixbuf_loader_close (loader, NULL);
|
|
|
b83518 |
break;
|
|
|
b83518 |
}
|