diff options
author | Albert Astals Cid <aacid@kde.org> | 2019-08-24 18:17:10 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2019-08-24 18:17:10 +0200 |
commit | a2f2f3b91fb007b0c17090d369179e7605c9a4b7 (patch) | |
tree | 130ad9cc73fca4ab3c1ab800f83fb0ae9685a56b | |
parent | 2e32545b1d2e31359775a65ef34e0385c9079126 (diff) |
GfxDeviceNColorSpace::parse: Only add to separationList if non null
Fixes crash with bug-poppler85281.pdf
-rw-r--r-- | poppler/GfxState.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc index f7810cb8..41d77ae4 100644 --- a/poppler/GfxState.cc +++ b/poppler/GfxState.cc @@ -3051,7 +3051,10 @@ GfxColorSpace *GfxDeviceNColorSpace::parse(GfxResources *res, Array *arr, Output for (i = 0; i < colorants->getLength(); i++) { Object obj3 = colorants->getVal(i); if (obj3.isArray()) { - separationList->push_back((GfxSeparationColorSpace*)GfxSeparationColorSpace::parse(res, obj3.getArray(), out, state, recursion)); + GfxSeparationColorSpace *cs = (GfxSeparationColorSpace*)GfxSeparationColorSpace::parse(res, obj3.getArray(), out, state, recursion); + if (cs) { + separationList->push_back(cs); + } } else { error(errSyntaxWarning, -1, "Bad DeviceN color space (colorant value entry is not an Array)"); goto err5; |