Chromium Code Reviews| Index: core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp |
| diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp |
| index 3f0de2d4168a5d0ba1685b179d078a6aa1ea29fe..6f1135ad94c3c564cc853bac7f64dfe9246c1613 100644 |
| --- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp |
| +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp |
| @@ -906,12 +906,14 @@ FX_BOOL CPDF_IndexedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) { |
| m_pCompMinMax[i * 2 + 1] -= m_pCompMinMax[i * 2]; |
| } |
| m_MaxIndex = pArray->GetInteger(2); |
| + |
| CPDF_Object* pTableObj = pArray->GetElementValue(3); |
| - if (pTableObj == NULL) { |
| + if (!pTableObj) |
| return FALSE; |
| - } |
| - if (pTableObj->GetType() == PDFOBJ_STRING) { |
| - m_Table = ((CPDF_String*)pTableObj)->GetString(); |
| + |
| + if (CPDF_String* pString = pTableObj->AsString()) { |
| + m_Table = pString->GetString(); |
| + |
|
Lei Zhang
2015/10/21 16:55:56
no blank line
dsinclair
2015/10/21 17:08:05
Done.
|
| } else if (pTableObj->GetType() == PDFOBJ_STREAM) { |
| CPDF_StreamAcc acc; |
| acc.LoadAllData((CPDF_Stream*)pTableObj, FALSE); |