summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render/cpdf_dibsource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/render/cpdf_dibsource.cpp')
-rw-r--r--core/fpdfapi/render/cpdf_dibsource.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/fpdfapi/render/cpdf_dibsource.cpp b/core/fpdfapi/render/cpdf_dibsource.cpp
index c1b96073d9..aff63d102d 100644
--- a/core/fpdfapi/render/cpdf_dibsource.cpp
+++ b/core/fpdfapi/render/cpdf_dibsource.cpp
@@ -686,7 +686,7 @@ int CPDF_DIBSource::StartLoadMask() {
m_pMaskStream = m_pDict->GetStreamFor("SMask");
if (m_pMaskStream) {
CPDF_Array* pMatte = m_pMaskStream->GetDict()->GetArrayFor("Matte");
- if (pMatte && m_pColorSpace &&
+ if (pMatte && m_pColorSpace && m_Family != PDFCS_PATTERN &&
m_pColorSpace->CountComponents() <= m_nComponents) {
float R, G, B;
std::vector<float> colors(m_nComponents);
@@ -752,6 +752,9 @@ void CPDF_DIBSource::LoadPalette() {
if (!m_pColorSpace) {
return;
}
+ if (m_Family == PDFCS_PATTERN)
+ return;
+
if (m_bpc * m_nComponents == 1) {
if (m_bDefaultDecode &&
(m_Family == PDFCS_DEVICEGRAY || m_Family == PDFCS_DEVICERGB)) {
@@ -922,7 +925,7 @@ void CPDF_DIBSource::TranslateScanline24bpp(uint8_t* dest_scan,
R = (1.0f - color_values[0]) * k;
G = (1.0f - color_values[1]) * k;
B = (1.0f - color_values[2]) * k;
- } else {
+ } else if (m_Family != PDFCS_PATTERN) {
m_pColorSpace->GetRGB(color_values, &R, &G, &B);
}
R = ClampValue(R, 1.0f);
@@ -948,7 +951,7 @@ void CPDF_DIBSource::TranslateScanline24bpp(uint8_t* dest_scan,
R = (1.0f - color_values[0]) * k;
G = (1.0f - color_values[1]) * k;
B = (1.0f - color_values[2]) * k;
- } else {
+ } else if (m_Family != PDFCS_PATTERN) {
m_pColorSpace->GetRGB(color_values, &R, &G, &B);
}
R = ClampValue(R, 1.0f);