aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pdf/SkPDFTypes.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pdf/SkPDFTypes.cpp b/src/pdf/SkPDFTypes.cpp
index f97f21bdfd..5a0ede8253 100644
--- a/src/pdf/SkPDFTypes.cpp
+++ b/src/pdf/SkPDFTypes.cpp
@@ -297,7 +297,8 @@ SkString SkPDFName::FormatName(const SkString& input) {
for (size_t i = 0; i < input.size(); i++) {
if (input[i] & 0x80 || input[i] < '!' || input[i] == '#') {
result.append("#");
- result.appendHex(input[i], 2);
+ // Mask with 0xFF to avoid sign extension. i.e. #FFFFFF81
+ result.appendHex(input[i] & 0xFF, 2);
} else {
result.append(input.c_str() + i, 1);
}