[poppler] poppler/Gfx.cc
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Dec 9 08:13:29 UTC 2020
poppler/Gfx.cc | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
New commits:
commit 4601e1d533a9c47e304b75435a104f5096a2b9a4
Author: Philipp Knechtges <philipp-dev at knechtges.com>
Date: Tue Dec 8 23:06:43 2020 +0100
Gfx: specifically use DeviceGray instead of DefaultGray for softmasks
diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index b8bf47ab..746703ab 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -4392,11 +4392,12 @@ void Gfx::doImage(Object *ref, Stream *str, bool inlineImg)
obj1 = std::move(obj2);
}
}
- maskColorSpace = GfxColorSpace::parse(nullptr, &obj1, out, state);
- if (!maskColorSpace || maskColorSpace->getMode() != csDeviceGray) {
- delete maskColorSpace;
+ // Here, we parse manually instead of using GfxColorSpace::parse,
+ // since we explicitly need DeviceGray and not some DefaultGray color space
+ if (!obj1.isName("DeviceGray") && !obj1.isName("G")) {
goto err1;
}
+ maskColorSpace = new GfxDeviceGrayColorSpace();
obj1 = maskDict->lookup("Decode");
if (obj1.isNull()) {
obj1 = maskDict->lookup("D");
More information about the poppler
mailing list