diff options
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp | 7 | ||||
-rw-r--r-- | testing/resources/pixel/bug_512557.in | bin | 0 -> 1329 bytes | |||
-rw-r--r-- | testing/resources/pixel/bug_512557_expected.pdf.0.png | bin | 0 -> 185 bytes |
3 files changed, 5 insertions, 2 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index 0362ff2e90..9497943fbd 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -957,8 +957,11 @@ void CPDF_DIBSource::ValidateDictParam() { m_bpc = 1; m_nComponents = 1; } - if (filter == FX_BSTRC("RunLengthDecode") || - filter == FX_BSTRC("DCTDecode")) { + if (filter == FX_BSTRC("RunLengthDecode")) { + if (m_bpc != 1) { + m_bpc = 8; + } + } else if (filter == FX_BSTRC("DCTDecode")) { m_bpc = 8; } } else if (pFilter->GetType() == PDFOBJ_ARRAY) { diff --git a/testing/resources/pixel/bug_512557.in b/testing/resources/pixel/bug_512557.in Binary files differnew file mode 100644 index 0000000000..5f353341d5 --- /dev/null +++ b/testing/resources/pixel/bug_512557.in diff --git a/testing/resources/pixel/bug_512557_expected.pdf.0.png b/testing/resources/pixel/bug_512557_expected.pdf.0.png Binary files differnew file mode 100644 index 0000000000..66c73aebea --- /dev/null +++ b/testing/resources/pixel/bug_512557_expected.pdf.0.png |