Do not do strict check of BitsPerComponent for RunLengthDecode filter
authorBo Xu <bo_xu@foxitsoftware.com>
Thu, 11 Dec 2014 00:45:46 +0000 (16:45 -0800)
committerBo Xu <bo_xu@foxitsoftware.com>
Thu, 11 Dec 2014 00:45:46 +0000 (16:45 -0800)
BUG=438421
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/790363002

core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp

index c5a96d6..f053e55 100644 (file)
@@ -946,8 +946,9 @@ void CPDF_DIBSource::ValidateDictParam()
                 m_bpc = 1;
                 m_nComponents = 1;
             }
-            if (pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("RunLengthDecode") ||
-                    pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("DCTDecode")) {
+            if (pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("DCTDecode")) {
+                // Previously, pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("RunLengthDecode") was checked in the "if" statement as well,
+                // but too many documents don't conform to it.
                 m_bpc = 8;
             }
         }