75a61b
From c114a90063d755639d2b0dbf816690a66b54bee0 Mon Sep 17 00:00:00 2001
75a61b
From: Albert Astals Cid <aacid@kde.org>
75a61b
Date: Sun, 8 Feb 2015 00:24:11 +0100
75a61b
Subject: Fix crash in fuzzed file from Bug #84988
75a61b
75a61b
75a61b
diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
75a61b
index c9db1e7..150d444 100644
75a61b
--- a/poppler/TextOutputDev.cc
75a61b
+++ b/poppler/TextOutputDev.cc
75a61b
@@ -20,7 +20,7 @@
75a61b
 // Copyright (C) 2006 Jeff Muizelaar <jeff@infidigm.net>
75a61b
 // Copyright (C) 2007, 2008, 2012 Adrian Johnson <ajohnson@redneon.com>
75a61b
 // Copyright (C) 2008 Koji Otani <sho@bbr.jp>
75a61b
-// Copyright (C) 2008, 2010-2012, 2014 Albert Astals Cid <aacid@kde.org>
75a61b
+// Copyright (C) 2008, 2010-2012, 2014, 2015 Albert Astals Cid <aacid@kde.org>
75a61b
 // Copyright (C) 2008 Pino Toscano <pino@kde.org>
75a61b
 // Copyright (C) 2008, 2010 Hib Eris <hib@hiberis.nl>
75a61b
 // Copyright (C) 2009 Ross Moore <ross@maths.mq.edu.au>
75a61b
@@ -622,6 +622,10 @@ void TextPool::addWord(TextWord *word) {
75a61b
   TextWord *w0, *w1;
75a61b
 
75a61b
   // expand the array if needed
75a61b
+  if (unlikely((word->base / textPoolStep) > INT_MAX)) {
75a61b
+      error(errSyntaxWarning, -1, "word->base / textPoolStep > INT_MAX");
75a61b
+      return;
75a61b
+  }
75a61b
   wordBaseIdx = (int)(word->base / textPoolStep);
75a61b
   if (minBaseIdx > maxBaseIdx) {
75a61b
     minBaseIdx = wordBaseIdx - 128;
75a61b
-- 
75a61b
cgit v0.10.2
75a61b