aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFObjectHandle.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDFObjectHandle.cc')
-rw-r--r--libqpdf/QPDFObjectHandle.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index cd03ef1c..3fa0266c 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -2340,7 +2340,10 @@ QPDFObjectHandle::shallowCopy()
if (isArray())
{
QTC::TC("qpdf", "QPDFObjectHandle shallow copy array");
- new_obj = newArray(getArrayAsVector());
+ // No newArray for shallow copying the sparse array
+ QPDF_Array* arr = dynamic_cast<QPDF_Array*>(m->obj.getPointer());
+ new_obj = QPDFObjectHandle(
+ new QPDF_Array(arr->getElementsForShallowCopy()));
}
else if (isDictionary())
{