From bb6405253b0d4c0805276d13171dd889d336dada Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Fri, 20 Dec 2019 16:00:44 +0100 Subject: [PATCH] Check scaled dimensions for 0 Resolves: #1785416 --- poppler-0.73.0-check-scaled-size.patch | 34 ++++++++++++++++++++++++++ poppler.spec | 9 ++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 poppler-0.73.0-check-scaled-size.patch diff --git a/poppler-0.73.0-check-scaled-size.patch b/poppler-0.73.0-check-scaled-size.patch new file mode 100644 index 0000000..01aa9e2 --- /dev/null +++ b/poppler-0.73.0-check-scaled-size.patch @@ -0,0 +1,34 @@ +From e0b8a980b71c29afdedaf37148c507947e83ce44 Mon Sep 17 00:00:00 2001 +From: Marek Kasik +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 + diff --git a/poppler.spec b/poppler.spec index f2bbd28..ca3eec2 100644 --- a/poppler.spec +++ b/poppler.spec @@ -4,7 +4,7 @@ Summary: PDF rendering library Name: poppler Version: 0.73.0 -Release: 14%{?dist} +Release: 15%{?dist} License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT URL: http://poppler.freedesktop.org/ 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 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: gcc-c++ BuildRequires: gettext-devel @@ -286,6 +289,10 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %{_mandir}/man1/* %changelog +* Fri Dec 20 2019 Marek Kasik - 0.73.0-15 +- Check scaled dimensions for 0 +- Resolves: #1785416 + * Wed Jul 24 2019 Marek Kasik - 0.73.0-14 - Ignore dict Length if it is broken - Resolves: #1732342