diff options
author | Matthew Olsson <matthewcolsson@gmail.com> | 2022-03-05 22:34:57 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-07 10:53:57 +0100 |
commit | 544e44eec1659bff76900514b804cf1f2b8e3e70 (patch) | |
tree | 71491eacc53d933052a32d04f215f12750cf69fa /Userland/Libraries/LibPDF | |
parent | 3cfecc3d3b8fdd821b6de3aba192a1ba732b4193 (diff) | |
download | serenity-544e44eec1659bff76900514b804cf1f2b8e3e70.zip |
LibPDF: Fix bad hex string parsing logic
Diffstat (limited to 'Userland/Libraries/LibPDF')
-rw-r--r-- | Userland/Libraries/LibPDF/Parser.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibPDF/Parser.cpp b/Userland/Libraries/LibPDF/Parser.cpp index 6efbaee840..6be4afa916 100644 --- a/Userland/Libraries/LibPDF/Parser.cpp +++ b/Userland/Libraries/LibPDF/Parser.cpp @@ -847,8 +847,10 @@ String Parser::parse_hex_string() hex_value *= 16; if (ch <= '9') { hex_value += ch - '0'; - } else { + } else if (ch >= 'A' && ch <= 'F') { hex_value += ch - 'A' + 10; + } else { + hex_value += ch - 'a' + 10; } } |