Remove mismatched delete.
Use SkAutoTArray to create an array and delete it safely. BUG=https://code.google.com/p/skia/issues/detail?id=1547 R=bungeman@google.com Review URL: https://codereview.chromium.org/23068033 git-svn-id: http://skia.googlecode.com/svn/trunk@10925 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
6e6dc653fc
commit
b9050d73f9
@ -336,10 +336,9 @@ SkString* SkObjectParser::TextToString(const void* text, size_t byteLength,
|
||||
case SkPaint::kUTF16_TextEncoding: {
|
||||
decodedText->append("UTF-16: ");
|
||||
size_t sizeNeeded = SkUTF16_ToUTF8((uint16_t*)text, byteLength / 2, NULL);
|
||||
char* utf8 = new char[sizeNeeded];
|
||||
SkAutoSTMalloc<0x100, char> utf8(sizeNeeded);
|
||||
SkUTF16_ToUTF8((uint16_t*)text, byteLength / 2, utf8);
|
||||
decodedText->append(utf8, sizeNeeded);
|
||||
delete utf8;
|
||||
break;
|
||||
}
|
||||
case SkPaint::kUTF32_TextEncoding: {
|
||||
|
Loading…
Reference in New Issue
Block a user