summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-03-17 11:48:22 -0700
committerTom Sepez <tsepez@chromium.org>2015-03-17 11:48:22 -0700
commita4161734ee7f2b64cbe3431385a4b4c9a426ca47 (patch)
tree301ba0b99bd7747574e7a34b0c6a9190811bf470 /core/src/fpdfapi/fpdf_render
parentb29e12ac58aea7ca43d726e152770e7ea80ab54a (diff)
downloadpdfium-a4161734ee7f2b64cbe3431385a4b4c9a426ca47.tar.xz
Revert "Fix a problem that JP2 image is not displayed because index color space is used"
This reverts commit 5a0e504d53195892458d819e52c62bea0c710bd5. Original review URL https://codereview.chromium.org/1009513003 Reason for revert: New "corpus" tests show that this is no longer rendering some images. See, e.g. http://chromegw/i/client.pdfium/builders/linux/builds/144/steps/corpus%20tests/logs/stdio for those that diff'd. TBR=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/1016823003
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index 4ed17cdfe5..79d73518a1 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -505,14 +505,10 @@ DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, FX
}
int max_data = (1 << m_bpc) - 1;
CPDF_Array* pDecode = m_pDict->GetArray(FX_BSTRC("Decode"));
- FX_DWORD arrSize = pDecode ? pDecode->GetCount() : 0;
- if (arrSize == 0) {
- return NULL;
- }
if (pDecode) {
for (FX_DWORD i = 0; i < m_nComponents; i ++) {
- pCompData[i].m_DecodeMin = pDecode->GetNumber((i * 2) % arrSize);
- FX_FLOAT max = pDecode->GetNumber((i * 2 + 1) % arrSize);
+ pCompData[i].m_DecodeMin = pDecode->GetNumber(i * 2);
+ FX_FLOAT max = pDecode->GetNumber(i * 2 + 1);
pCompData[i].m_DecodeStep = (max - pCompData[i].m_DecodeMin) / max_data;
FX_FLOAT def_value, def_min, def_max;
m_pColorSpace->GetDefaultValue(i, def_value, def_min, def_max);