Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp |
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp |
index 238347a6615690e59981c020249ead2ccb8c513f..34f4b3c67147adab5a5dc00cce672eb0f6f626d5 100644 |
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp |
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp |
@@ -337,8 +337,9 @@ FX_BOOL CPDF_Document::IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) const { |
{ |
CPDF_Object* pObj; |
if (m_IndirectObjs.Lookup((void*)(uintptr_t)objnum, (void*&)pObj)) { |
- bForm = pObj->GetType() == PDFOBJ_STREAM && |
- ((CPDF_Stream*)pObj)->GetDict()->GetString(FX_BSTRC("Subtype")) == |
+ CPDF_Stream* pStream = pObj->AsStream(); |
+ bForm = pStream && |
+ pStream->GetDict()->GetString(FX_BSTRC("Subtype")) == |
FX_BSTRC("Form"); |
return TRUE; |
} |