Commit 552303a94a997f403e3e966c9d6967d535c7428b
1 parent
c9c711a3
Check for reserved after dereference
Showing
1 changed file
with
2 additions
and
2 deletions
libqpdf/QPDFObjectHandle.cc
| ... | ... | @@ -1754,12 +1754,12 @@ QPDFObjectHandle::unparse() |
| 1754 | 1754 | std::string |
| 1755 | 1755 | QPDFObjectHandle::unparseResolved() |
| 1756 | 1756 | { |
| 1757 | + dereference(); | |
| 1757 | 1758 | if (this->reserved) |
| 1758 | 1759 | { |
| 1759 | 1760 | throw std::logic_error( |
| 1760 | 1761 | "QPDFObjectHandle: attempting to unparse a reserved object"); |
| 1761 | 1762 | } |
| 1762 | - dereference(); | |
| 1763 | 1763 | return this->obj->unparse(); |
| 1764 | 1764 | } |
| 1765 | 1765 | |
| ... | ... | @@ -1786,12 +1786,12 @@ QPDFObjectHandle::getJSON(bool dereference_indirect) |
| 1786 | 1786 | } |
| 1787 | 1787 | else |
| 1788 | 1788 | { |
| 1789 | + dereference(); | |
| 1789 | 1790 | if (this->reserved) |
| 1790 | 1791 | { |
| 1791 | 1792 | throw std::logic_error( |
| 1792 | 1793 | "QPDFObjectHandle: attempting to unparse a reserved object"); |
| 1793 | 1794 | } |
| 1794 | - dereference(); | |
| 1795 | 1795 | return this->obj->getJSON(); |
| 1796 | 1796 | } |
| 1797 | 1797 | } | ... | ... |