summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdf_flatten.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/fpdf_flatten.cpp')
-rw-r--r--fpdfsdk/src/fpdf_flatten.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp
index 75db8f806d..39441c4aef 100644
--- a/fpdfsdk/src/fpdf_flatten.cpp
+++ b/fpdfsdk/src/fpdf_flatten.cpp
@@ -444,10 +444,12 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
CFX_ByteString sKey;
CPDF_Object* pFirstObj = pAPDic->GetNextElement(pos, sKey);
if (pFirstObj) {
- if (pFirstObj->IsReference())
+ if (pFirstObj->GetType() == PDFOBJ_REFERENCE)
pFirstObj = pFirstObj->GetDirect();
+
if (!pFirstObj->IsStream())
continue;
+
pAPStream = pFirstObj->AsStream();
}
}