Check scaled dimensions for 0

Resolves: #1785416
This commit is contained in:
Marek Kasik 2019-12-20 16:00:44 +01:00
parent e2efd8b527
commit bb6405253b
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From e0b8a980b71c29afdedaf37148c507947e83ce44 Mon Sep 17 00:00:00 2001
From: Marek Kasik <mkasik@redhat.com>
Date: Fri, 20 Sep 2019 16:33:04 +0200
Subject: [PATCH] CairoOutputDev: Check scaled dimensions for 0
Check scaledWidth and scaledHeight for 0 at RescaleDrawImage::getSourceImage()
as is done on other places. Set the dimension to 1 if it is 0.
Fixes issue #737
---
poppler/CairoOutputDev.cc | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index 68927636..12f312c6 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -3134,6 +3134,13 @@ public:
scaledWidth = MAX_PRINT_IMAGE_SIZE * (double)width/height;
}
needsCustomDownscaling = true;
+
+ if (scaledWidth == 0) {
+ scaledWidth = 1;
+ }
+ if (scaledHeight == 0) {
+ scaledHeight = 1;
+ }
} else {
needsCustomDownscaling = false;
}
--
2.21.0

View File

@ -4,7 +4,7 @@
Summary: PDF rendering library Summary: PDF rendering library
Name: poppler Name: poppler
Version: 0.73.0 Version: 0.73.0
Release: 14%{?dist} Release: 15%{?dist}
License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT
URL: http://poppler.freedesktop.org/ URL: http://poppler.freedesktop.org/
Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz
@ -56,6 +56,9 @@ Patch18: poppler-0.73.0-PSOutputDev-buffer-read.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1732340 # https://bugzilla.redhat.com/show_bug.cgi?id=1732340
Patch19: poppler-0.73.0-JPXStream-length.patch Patch19: poppler-0.73.0-JPXStream-length.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1785416
Patch20: poppler-0.73.0-check-scaled-size.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: gettext-devel BuildRequires: gettext-devel
@ -286,6 +289,10 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}"
%{_mandir}/man1/* %{_mandir}/man1/*
%changelog %changelog
* Fri Dec 20 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-15
- Check scaled dimensions for 0
- Resolves: #1785416
* Wed Jul 24 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-14 * Wed Jul 24 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-14
- Ignore dict Length if it is broken - Ignore dict Length if it is broken
- Resolves: #1732342 - Resolves: #1732342