Fix blank page issue caused by too strict correction on bpc
[pdfium.git] / core / src / fpdfapi / fpdf_render / fpdf_render_loadimage.cpp
index 0362ff2..9497943 100644 (file)
@@ -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) {