Commit 4bc434000c42a7191e705c8a38216ca6743ad9ff
1 parent
aad2b108
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.
Showing
1 changed file
with
1 additions
and
0 deletions
libqpdf/QPDFPageObjectHelper.cc
| ... | ... | @@ -156,6 +156,7 @@ QPDFPageObjectHelper::removeUnreferencedResources() |
| 156 | 156 | { |
| 157 | 157 | continue; |
| 158 | 158 | } |
| 159 | + dict = dict.shallowCopy(); | |
| 159 | 160 | resources.replaceKey(*d_iter, dict); |
| 160 | 161 | std::set<std::string> keys = dict.getKeys(); |
| 161 | 162 | for (std::set<std::string>::iterator k_iter = keys.begin(); | ... | ... |