Index: kpdf/xpdf/xpdf/Stream.cc =================================================================== --- kpdf/xpdf/xpdf/Stream.cc (revision 689574) +++ kpdf/xpdf/xpdf/Stream.cc (working copy) @@ -411,9 +411,9 @@ StreamPredictor::StreamPredictor(Stream nVals = width * nComps; if (width <= 0 || nComps <= 0 || nBits <= 0 || - nComps >= INT_MAX / nBits || - width >= INT_MAX / nComps / nBits || - nVals * nBits + 7 < 0) { + nComps > gfxColorMaxComps || nBits > 16 || + width >= INT_MAX / nComps || + nVals >= (INT_MAX - 7) / nBits) { return; } pixBytes = (nComps * nBits + 7) >> 3;