From 19ebd40547186a8ea6da08c8d8e2a6d6b7e84f5d Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 13 Oct 2017 00:55:49 +0200 Subject: [PATCH] CairoOutputDev: Fix crash in broken files Bug #103016 --- poppler/CairoOutputDev.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index ffd39ef7..80f7a99e 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -2714,7 +2714,9 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s for (y = 0; y < maskHeight; y++) { maskDest = (unsigned char *) (maskBuffer + y * row_stride); pix = maskImgStr->getLine(); - maskColorMap->getGrayLine (pix, maskDest, maskWidth); + if (likely(pix != nullptr)) { + maskColorMap->getGrayLine (pix, maskDest, maskWidth); + } } maskImgStr->close(); -- 2.14.1