poppler/GfxState.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
New commits: commit 8a845c65e0dc290af920ce4175689f7321e1d459 Author: Albert Astals Cid <[email protected]> Date: Sun Sep 23 01:45:38 2018 +0200 Fix crash introduced by c792e4cde92e6ece06592955068ffb579e826382 We need to initialize properly the fields that will be used in the destructor before bailing out diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc index 3137851d..ef5aefbc 100644 --- a/poppler/GfxState.cc +++ b/poppler/GfxState.cc @@ -5707,13 +5707,21 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, ok = gTrue; useMatte = gFalse; + colorSpace = colorSpaceA; + + // initialize + for (k = 0; k < gfxColorMaxComps; ++k) { + lookup[k] = nullptr; + lookup2[k] = nullptr; + } + byte_lookup = nullptr; + // bits per component and color space if (unlikely(bitsA <= 0 || bitsA > 30)) goto err1; bits = bitsA; maxPixel = (1 << bits) - 1; - colorSpace = colorSpaceA; // this is a hack to support 16 bits images, everywhere // we assume a component fits in 8 bits, with this hack @@ -5721,13 +5729,6 @@ GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode, // The hack has another part on ImageStream::getLine if (maxPixel > 255) maxPixel = 255; - // initialize - for (k = 0; k < gfxColorMaxComps; ++k) { - lookup[k] = nullptr; - lookup2[k] = nullptr; - } - byte_lookup = nullptr; - // get decode map if (decode->isNull()) { nComps = colorSpace->getNComps(); _______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
