2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 10:58:58 +00:00

Check for reserved after dereference

This commit is contained in:
Jay Berkenbilt 2021-03-03 14:22:15 -05:00
parent c9c711a351
commit 552303a94a

View File

@ -1754,12 +1754,12 @@ QPDFObjectHandle::unparse()
std::string
QPDFObjectHandle::unparseResolved()
{
dereference();
if (this->reserved)
{
throw std::logic_error(
"QPDFObjectHandle: attempting to unparse a reserved object");
}
dereference();
return this->obj->unparse();
}
@ -1786,12 +1786,12 @@ QPDFObjectHandle::getJSON(bool dereference_indirect)
}
else
{
dereference();
if (this->reserved)
{
throw std::logic_error(
"QPDFObjectHandle: attempting to unparse a reserved object");
}
dereference();
return this->obj->getJSON();
}
}