mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
LibPDF: Parser::parse_header() return false if remaining bytes is zero
This commit is contained in:
parent
92fdae178b
commit
6ccfa3e75e
1 changed files with 2 additions and 0 deletions
|
@ -91,6 +91,8 @@ bool Parser::parse_header()
|
||||||
{
|
{
|
||||||
// FIXME: Do something with the version?
|
// FIXME: Do something with the version?
|
||||||
m_reader.set_reading_forwards();
|
m_reader.set_reading_forwards();
|
||||||
|
if (m_reader.remaining() == 0)
|
||||||
|
return false;
|
||||||
m_reader.move_to(0);
|
m_reader.move_to(0);
|
||||||
if (m_reader.remaining() < 8 || !m_reader.matches("%PDF-"))
|
if (m_reader.remaining() < 8 || !m_reader.matches("%PDF-"))
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue