Index: fpdfsdk/cpdfsdk_widget.cpp |
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp |
index d4fc5c790022acc04fb23fa21deb8f5ee9b45d76..cc2a7670398bf27f3c863233fef263f75bb6b585 100644 |
--- a/fpdfsdk/cpdfsdk_widget.cpp |
+++ b/fpdfsdk/cpdfsdk_widget.cpp |
@@ -1835,11 +1835,9 @@ void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType, |
pStreamDict->SetFor("Resources", pStreamResList); |
} |
- if (pStreamResList) { |
- CPDF_Dictionary* pXObject = new CPDF_Dictionary; |
- pXObject->SetReferenceFor(sImageAlias, pDoc, pImage); |
- pStreamResList->SetFor("XObject", pXObject); |
- } |
+ CPDF_Dictionary* pXObject = new CPDF_Dictionary; |
+ pXObject->SetReferenceFor(sImageAlias, pDoc, pImage->GetObjNum()); |
+ pStreamResList->SetFor("XObject", pXObject); |
} |
void CPDFSDK_Widget::RemoveAppearance(const CFX_ByteString& sAPType) { |