diff options
author | vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-03-05 18:44:33 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-03-05 18:44:33 +0000 |
commit | c0376febfc855870a0e109d39ee62e82f0ab2139 (patch) | |
tree | 74d638f61cc6a229cb2bf188fbe48b226444a970 /src | |
parent | 178b8e0b8c3d423c3fd947776f4b7790a0417582 (diff) |
[PDF] Fix name objects containing characters > 0x80 and add a test.
This fixes chrome bug http://crbug.com/115258
Review URL: https://codereview.appspot.com/5726048
git-svn-id: http://skia.googlecode.com/svn/trunk@3319 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/pdf/SkPDFTypes.cpp | 3 |
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); } |