Bug 643137 - strict alignment issues when displaying OpenType fonts on sparc64. r=roc

This commit is contained in:
Landry Breuil 2011-03-26 17:04:18 +01:00
parent d6412bb1fd
commit 716b7f03e7

View File

@ -68,8 +68,10 @@ class OTSStream {
}
while (length >= 4) {
chksum_ += ntohl(*reinterpret_cast<const uint32_t*>(
reinterpret_cast<const uint8_t*>(data) + offset));
uint32_t tmp;
std::memcpy(&tmp, reinterpret_cast<const uint8_t *>(data) + offset,
sizeof(uint32_t));
chksum_ += ntohl(tmp);
length -= 4;
offset += 4;
}