diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc index 85d657b..dce487d 100644 --- a/poppler/Gfx.cc +++ b/poppler/Gfx.cc @@ -4398,28 +4398,29 @@ void Gfx::doForm1(Object *str, Dict *resDict, double *matrix, double *bbox, // in-line image operators //------------------------------------------------------------------------ -void Gfx::opBeginImage(Object args[], int numArgs) { - Stream *str; - int c1, c2; - - // build dict/stream - str = buildImageStream(); - - // display the image - if (str) { - doImage(NULL, str, gTrue); - - // skip 'EI' tag - c1 = str->getUndecodedStream()->getChar(); - c2 = str->getUndecodedStream()->getChar(); - while (!(c1 == 'E' && c2 == 'I') && c2 != EOF) { - c1 = c2; - c2 = str->getUndecodedStream()->getChar(); - } - delete str; - } -} - +void Gfx::opBeginImage(Object args[], int numArgs) { + Stream *str; + int c1, c2, c3; + + // build dict/stream + str = buildImageStream(); + + // display the image + if (str) { + doImage(NULL, str, gTrue); + + // skip 'EI' tag + c1 = str->getUndecodedStream()->getChar(); + c2 = str->getUndecodedStream()->getChar(); + c3 = str->getUndecodedStream()->getChar(); + while (!((c1 == '\r' || c1 == '\n') && c2 == 'E' && c3 == 'I') && c3 != EOF) { + c1 = c2; + c2 = c3; + c3 = str->getUndecodedStream()->getChar(); + } + delete str; + } +} Stream *Gfx::buildImageStream() { Object dict; Object obj; diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc index ab0722a..eb45b16 100644 --- a/poppler/SplashOutputDev.cc +++ b/poppler/SplashOutputDev.cc @@ -2901,7 +2901,6 @@ void SplashOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, state->shiftCTM(-tx, -ty); updateCTM(state, 0, 0, 0, 0, 0, 0); } - void SplashOutputDev::endTransparencyGroup(GfxState *state) { double *ctm; @@ -2937,9 +2936,9 @@ void SplashOutputDev::paintTransparencyGroup(GfxState * /*state*/, double * /*bb delete transpGroup; delete tBitmap; -} + } -void SplashOutputDev::setSoftMask(GfxState * /*state*/, double * /*bbox*/, +void SplashOutputDev::setSoftMask(GfxState * state, double * /*bbox*/, GBool alpha, Function *transferFunc, GfxColor *backdropColor) { SplashBitmap *softMask, *tBitmap; @@ -3002,7 +3001,8 @@ void SplashOutputDev::setSoftMask(GfxState * /*state*/, double * /*bbox*/, softMask = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(), 1, splashModeMono8, gFalse); - memset(softMask->getDataPtr(), 0, + unsigned char fill = (state->getAlphaIsShape()) ? 255 : 0; + memset(softMask->getDataPtr(), fill, softMask->getRowSize() * softMask->getHeight()); p = softMask->getDataPtr() + ty * softMask->getRowSize() + tx; int xMax = tBitmap->getWidth();