1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:47:35 +00:00

LibPDF: Harden the document/parser against errors

This commit is contained in:
Matthew Olsson 2021-05-24 13:57:16 -07:00 committed by Ali Mohammad Pur
parent d654fe0e41
commit 1ef5071d1b
6 changed files with 217 additions and 108 deletions

View file

@ -61,6 +61,16 @@ public:
m_as_ref = (generation_index << 14) | index;
}
template<IsObject T>
Value(RefPtr<T> obj)
: m_type(obj ? Type::Object : Type::Empty)
{
if (obj) {
obj->ref();
m_as_object = obj;
}
}
template<IsObject T>
Value(NonnullRefPtr<T> obj)
: m_type(Type::Object)