commit 4bc434000c42a7191e705c8a38216ca6743ad9ff
Author: Jay Berkenbilt <ejb@ql.org>
Date:   Thu Jan 17 08:50:19 2019 -0500

    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.

Index: qpdf/libqpdf/QPDFPageObjectHelper.cc
===================================================================
--- qpdf.orig/libqpdf/QPDFPageObjectHelper.cc
+++ qpdf/libqpdf/QPDFPageObjectHelper.cc
@@ -155,6 +155,7 @@ QPDFPageObjectHelper::removeUnreferenced
         {
             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();
