[poppler] poppler/GfxState.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Thu May 4 19:26:01 UTC 2017
poppler/GfxState.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit b2545e9368a58a6987614f75d39da4568a076881
Author: Albert Astals Cid <aacid at kde.org>
Date: Thu May 4 21:24:23 2017 +0200
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 331d78cf..2c81dfbe 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -16,7 +16,7 @@
// Copyright (C) 2005 Kristian Høgsberg <krh at redhat.com>
// Copyright (C) 2006, 2007 Jeff Muizelaar <jeff at infidigm.net>
// Copyright (C) 2006, 2010 Carlos Garcia Campos <carlosgc at gnome.org>
-// Copyright (C) 2006-2016 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2006-2017 Albert Astals Cid <aacid at kde.org>
// Copyright (C) 2009, 2012 Koji Otani <sho at bbr.jp>
// Copyright (C) 2009, 2011-2016 Thomas Freitag <Thomas.Freitag at alfa.de>
// Copyright (C) 2009 Christian Persch <chpe at gnome.org>
@@ -2663,7 +2663,7 @@ GfxColor *GfxIndexedColorSpace::mapColorToBase(GfxColor *color,
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]);
More information about the poppler
mailing list