summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2022-03-05 22:34:57 -0700
committerAndreas Kling <kling@serenityos.org>2022-03-07 10:53:57 +0100
commit544e44eec1659bff76900514b804cf1f2b8e3e70 (patch)
tree71491eacc53d933052a32d04f215f12750cf69fa
parent3cfecc3d3b8fdd821b6de3aba192a1ba732b4193 (diff)
downloadserenity-544e44eec1659bff76900514b804cf1f2b8e3e70.zip
LibPDF: Fix bad hex string parsing logic
-rw-r--r--Userland/Libraries/LibPDF/Parser.cpp4
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;
}
}