import evince-3.28.4-3.el8

This commit is contained in:
CentOS Sources 2019-11-05 15:54:36 -05:00 committed by Andrew Lukoshko
parent a15853f171
commit 962ace4f09
2 changed files with 86 additions and 1 deletions

View File

@ -0,0 +1,72 @@
From 3e38d5ad724a042eebadcba8c2d57b0f48b7a8c7 Mon Sep 17 00:00:00 2001
From: Jason Crain <jcrain@src.gnome.org>
Date: Mon, 15 Apr 2019 23:06:36 -0600
Subject: [PATCH] tiff: Handle failure from TIFFReadRGBAImageOriented
The TIFFReadRGBAImageOriented function returns zero if it was unable to
read the image. Return NULL in this case instead of displaying
uninitialized memory.
Fixes #1129
---
backend/tiff/tiff-document.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/backend/tiff/tiff-document.c b/backend/tiff/tiff-document.c
index 7715031b..38bb3bd8 100644
--- a/backend/tiff/tiff-document.c
+++ b/backend/tiff/tiff-document.c
@@ -292,18 +292,22 @@ tiff_document_render (EvDocument *document,
g_warning("Failed to allocate memory for rendering.");
return NULL;
}
-
+
+ if (!TIFFReadRGBAImageOriented (tiff_document->tiff,
+ width, height,
+ (uint32 *)pixels,
+ orientation, 0)) {
+ g_warning ("Failed to read TIFF image.");
+ g_free (pixels);
+ return NULL;
+ }
+
surface = cairo_image_surface_create_for_data (pixels,
CAIRO_FORMAT_RGB24,
width, height,
rowstride);
cairo_surface_set_user_data (surface, &key,
pixels, (cairo_destroy_func_t)g_free);
-
- TIFFReadRGBAImageOriented (tiff_document->tiff,
- width, height,
- (uint32 *)pixels,
- orientation, 0);
pop_handlers ();
/* Convert the format returned by libtiff to
@@ -384,13 +388,17 @@ tiff_document_get_thumbnail (EvDocument *document,
if (!pixels)
return NULL;
+ if (!TIFFReadRGBAImageOriented (tiff_document->tiff,
+ width, height,
+ (uint32 *)pixels,
+ ORIENTATION_TOPLEFT, 0)) {
+ g_free (pixels);
+ return NULL;
+ }
+
pixbuf = gdk_pixbuf_new_from_data (pixels, GDK_COLORSPACE_RGB, TRUE, 8,
width, height, rowstride,
(GdkPixbufDestroyNotify) g_free, NULL);
- TIFFReadRGBAImageOriented (tiff_document->tiff,
- width, height,
- (uint32 *)pixels,
- ORIENTATION_TOPLEFT, 0);
pop_handlers ();
ev_render_context_compute_scaled_size (rc, width, height * (x_res / y_res),
--
2.21.0

View File

@ -5,7 +5,7 @@
Name: evince
Version: 3.28.4
Release: 1%{?dist}
Release: 3%{?dist}
Summary: Document viewer
License: GPLv2+ and GPLv3+ and LGPLv2+ and MIT and Afmparse
@ -19,6 +19,8 @@ Patch6: 0001-Revert-Bump-poppler-requirements-to-0.33.0.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1602486
Patch7: evince-3.28.2-covscan.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1716295
Patch8: evince-3.28.2-TIFFReadRGBAImageOriented.patch
BuildRequires: pkgconfig(adwaita-icon-theme)
BuildRequires: pkgconfig(gio-unix-2.0) >= %{glib2_version}
@ -102,6 +104,7 @@ This package contains a backend to let evince display djvu files.
%package nautilus
Summary: Evince extension for nautilus
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: nautilus%{?_isa}
%description nautilus
@ -112,6 +115,7 @@ It adds an additional tab called "Document" to the file properties dialog.
%package browser-plugin
Summary: Evince web browser plugin
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: mozilla-filesystem
%description browser-plugin
@ -246,6 +250,15 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/evince.desktop
%{_libdir}/mozilla/plugins/libevbrowserplugin.so
%changelog
* Mon Jun 17 2019 Marek Kasik <mkasik@redhat.com> - 3.28.4-3
- Add requirement on evince-libs for nautilus and browser-plugin
- subpackages (RPMDiff)
- Related: #1717353
* Tue Jun 11 2019 Marek Kasik <mkasik@redhat.com> - 3.28.4-2
- Handle failure from TIFFReadRGBAImageOriented()
- Resolves: #1717353
* Mon Oct 1 2018 Marek Kasik <mkasik@redhat.com> - 3.28.4-1
- Update to 3.28.4