Fix regression in GfxIndexedColorSpace::mapColorToBase

The bounds check was off by one, making file from bug 100931 render
incorrectly. Bug #100931
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 331d78c..2c81dfb 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -16,7 +16,7 @@
 // Copyright (C) 2005 Kristian Høgsberg <krh@redhat.com>
 // Copyright (C) 2006, 2007 Jeff Muizelaar <jeff@infidigm.net>
 // Copyright (C) 2006, 2010 Carlos Garcia Campos <carlosgc@gnome.org>
-// Copyright (C) 2006-2016 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2006-2017 Albert Astals Cid <aacid@kde.org>
 // Copyright (C) 2009, 2012 Koji Otani <sho@bbr.jp>
 // Copyright (C) 2009, 2011-2016 Thomas Freitag <Thomas.Freitag@alfa.de>
 // Copyright (C) 2009 Christian Persch <chpe@gnome.org>
@@ -2663,7 +2663,7 @@
   n = base->getNComps();
   base->getDefaultRanges(low, range, indexHigh);
   const int idx = (int)(colToDbl(color->c[0]) + 0.5) * n;
-  if (likely((idx + n < (indexHigh + 1) * base->getNComps()) && idx >= 0)) {
+  if (likely((idx + n - 1 < (indexHigh + 1) * base->getNComps()) && idx >= 0)) {
     p = &lookup[idx];
     for (i = 0; i < n; ++i) {
       baseColor->c[i] = dblToCol(low[i] + (p[i] / 255.0) * range[i]);