poppler/GfxState.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
New commits: commit 1b5298ebb8d76b5eee11d9cccdfffcdceb5d064b Author: Albert Astals Cid <[email protected]> Date: Mon Jul 2 21:46:10 2018 +0200 GfxUnivariateShading::getColor: Fix uninitialized memory read fixes oss-fuzz/9165 diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc index f065b672..e4b08e71 100644 --- a/poppler/GfxState.cc +++ b/poppler/GfxState.cc @@ -3900,10 +3900,13 @@ GfxUnivariateShading::~GfxUnivariateShading() { int GfxUnivariateShading::getColor(double t, GfxColor *color) { double out[gfxColorMaxComps]; + int nComps; - // NB: there can be one function with n outputs or n functions with - // one output each (where n = number of color components) - const int nComps = nFuncs * funcs[0]->getOutputSize(); + if (likely(nFuncs >= 1)) { + // NB: there can be one function with n outputs or n functions with + // one output each (where n = number of color components) + nComps = nFuncs * funcs[0]->getOutputSize(); + } if (unlikely(nFuncs < 1 || nComps > gfxColorMaxComps)) { for (int i = 0; i < gfxColorMaxComps; i++) _______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
