Index: src/core/SkWriter32.cpp |
diff --git a/src/core/SkWriter32.cpp b/src/core/SkWriter32.cpp |
index c7bfd92d56aafd832868c42f2690f3bcd8082ef3..3397c37360df64df2878da127a6248586ce76804 100644 |
--- a/src/core/SkWriter32.cpp |
+++ b/src/core/SkWriter32.cpp |
@@ -47,7 +47,7 @@ void SkWriter32::writeString(const char str[], size_t len) { |
// [ 4 byte len ] [ str ... ] [1 - 4 \0s] |
uint32_t* ptr = this->reservePad(sizeof(uint32_t) + len + 1); |
- *ptr = len; |
+ *ptr = SkToU32(len); |
char* chars = (char*)(ptr + 1); |
memcpy(chars, str, len); |
chars[len] = '\0'; |