diff --git a/Userland/Libraries/LibPDF/Parser.cpp b/Userland/Libraries/LibPDF/Parser.cpp index 95f9c8dea6..eba8c21ad2 100644 --- a/Userland/Libraries/LibPDF/Parser.cpp +++ b/Userland/Libraries/LibPDF/Parser.cpp @@ -380,7 +380,9 @@ PDFErrorOr Parser::parse_hex_string() builder.append(static_cast(hex_value)); return builder.to_deprecated_string(); } - VERIFY(isxdigit(ch)); + + if (!isxdigit(ch)) + return error("character in hex string isn't hex digit"); hex_value *= 16; if (ch <= '9') {