浏览代码

LibPDF: Fix bad hex string parsing logic

Matthew Olsson 3 年之前
父节点
当前提交
544e44eec1
共有 1 个文件被更改,包括 3 次插入1 次删除
  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;
                 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;
                 }
             }