diff options
author | John Reck <jreck@google.com> | 2012-08-16 19:25:35 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2012-08-16 19:25:35 -0700 |
commit | ae24a859d8f7fd453d77a8da50a0e18493fb2f77 (patch) | |
tree | a9c8547b21affa664d52e8fffe87824efd0ae3a2 | |
parent | f693ed1ffc7b8c47b6ce8d56ebc6b35d9790e473 (diff) | |
download | external_webkit-ae24a859d8f7fd453d77a8da50a0e18493fb2f77.zip external_webkit-ae24a859d8f7fd453d77a8da50a0e18493fb2f77.tar.gz external_webkit-ae24a859d8f7fd453d77a8da50a0e18493fb2f77.tar.bz2 |
Fix SIGBUG due to misalignment
Bug: 7003956
Don't pack data
Change-Id: I659a8b4cbf47ece9af16532949466f3fe2f6e61b
-rw-r--r-- | Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp index 5083222..2a7db11 100644 --- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp +++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp @@ -902,9 +902,9 @@ void PlatformGraphicsContextRecording::drawPosText(const void* inText, size_t by } FloatRect bounds = approximateTextBounds(byteLength / sizeof(uint16_t), inPos, inPaint); const SkPaint* paint = mRecording->recording()->getSkPaint(inPaint); - int posSize = sizeof(SkPoint) * paint->countText(inText, byteLength); - void* text = heap()->alloc(posSize + byteLength); - SkPoint* pos = (SkPoint*) ((char*)text + byteLength); + size_t posSize = sizeof(SkPoint) * paint->countText(inText, byteLength); + void* text = heap()->alloc(byteLength); + SkPoint* pos = (SkPoint*) heap()->alloc(posSize); memcpy(text, inText, byteLength); memcpy(pos, inPos, posSize); appendDrawingOperation(NEW_OP(DrawPosText)(text, byteLength, pos, paint), bounds); |