aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFPageObjectHelper.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-01-17 14:50:19 +0100
committerJay Berkenbilt <ejb@ql.org>2019-01-17 15:40:05 +0100
commit4bc434000c42a7191e705c8a38216ca6743ad9ff (patch)
treeddee55d9a6acd6ae3545d6109949b8303cb548ec /libqpdf/QPDFPageObjectHelper.cc
parentaad2b10800cf081d62770756e61ca18daafcbb62 (diff)
downloadqpdf-4bc434000c42a7191e705c8a38216ca6743ad9ff.tar.zst
Copy subdictionaries when removing resources (fixes #276)
When removing unreferenced resources, the code was copying the overall resource dictionaries but not the subdictionaries being modified. This was a "typo" in the code -- the comment clearly stated the need to do this, but the code replaced the dictionary with itself rather than with a shallow copy of itself.
Diffstat (limited to 'libqpdf/QPDFPageObjectHelper.cc')
-rw-r--r--libqpdf/QPDFPageObjectHelper.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/libqpdf/QPDFPageObjectHelper.cc b/libqpdf/QPDFPageObjectHelper.cc
index 611f33ea..ba647372 100644
--- a/libqpdf/QPDFPageObjectHelper.cc
+++ b/libqpdf/QPDFPageObjectHelper.cc
@@ -156,6 +156,7 @@ QPDFPageObjectHelper::removeUnreferencedResources()
{
continue;
}
+ dict = dict.shallowCopy();
resources.replaceKey(*d_iter, dict);
std::set<std::string> keys = dict.getKeys();
for (std::set<std::string>::iterator k_iter = keys.begin();