Browse Source

LibPDF: Fix bad hex string parsing logic

Matthew Olsson 3 years ago
parent
commit
544e44eec1
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Userland/Libraries/LibPDF/Parser.cpp

+ 3 - 1
Userland/Libraries/LibPDF/Parser.cpp

@@ -847,8 +847,10 @@ String Parser::parse_hex_string()
                 hex_value *= 16;
                 hex_value *= 16;
                 if (ch <= '9') {
                 if (ch <= '9') {
                     hex_value += ch - '0';
                     hex_value += ch - '0';
-                } else {
+                } else if (ch >= 'A' && ch <= 'F') {
                     hex_value += ch - 'A' + 10;
                     hex_value += ch - 'A' + 10;
+                } else {
+                    hex_value += ch - 'a' + 10;
                 }
                 }
             }
             }