mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibPDF: Fix bad hex string parsing logic
This commit is contained in:
parent
3cfecc3d3b
commit
544e44eec1
Notes:
sideshowbarker
2024-07-17 17:50:41 +09:00
Author: https://github.com/mattco98
Commit: 544e44eec1
Pull-request: https://github.com/SerenityOS/serenity/pull/12920
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue