c6ff02
From b224e2f5739fe61de9fa69955d016725b2a4b78d Mon Sep 17 00:00:00 2001
c6ff02
From: Albert Astals Cid <aacid@kde.org>
c6ff02
Date: Mon, 15 Jul 2019 22:11:09 +0200
c6ff02
Subject: [PATCH] SplashOutputDev::tilingPatternFill: Fix crash on broken file
c6ff02
c6ff02
Issue #802
c6ff02
---
c6ff02
 poppler/SplashOutputDev.cc | 4 ++++
c6ff02
 1 file changed, 4 insertions(+)
c6ff02
c6ff02
diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
c6ff02
index 544f132d..3d2befc2 100644
c6ff02
--- a/poppler/SplashOutputDev.cc
c6ff02
+++ b/poppler/SplashOutputDev.cc
c6ff02
@@ -4581,6 +4581,10 @@ bool SplashOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat
c6ff02
     surface_width = (int) ceil (fabs(kx));
c6ff02
     surface_height = (int) ceil (fabs(ky));
c6ff02
     // adjust repeat values to completely fill region
c6ff02
+    if (unlikely(surface_width == 0 || surface_height == 0)) {
c6ff02
+        state->setCTM(savedCTM[0], savedCTM[1], savedCTM[2], savedCTM[3], savedCTM[4], savedCTM[5]);
c6ff02
+        return gFalse;
c6ff02
+    }
c6ff02
     repeatX = result_width / surface_width;
c6ff02
     repeatY = result_height / surface_height;
c6ff02
     if (surface_width * repeatX < result_width)
c6ff02
-- 
c6ff02
2.24.1
c6ff02