summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-08-16 19:31:09 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-16 19:31:09 -0700
commitf7172287cc11064b1e667b71e8087093e13bdf36 (patch)
treea9c8547b21affa664d52e8fffe87824efd0ae3a2
parenta8b0ead598943dfdb7b200920d15fefbc15c6904 (diff)
parentae24a859d8f7fd453d77a8da50a0e18493fb2f77 (diff)
downloadexternal_webkit-f7172287cc11064b1e667b71e8087093e13bdf36.zip
external_webkit-f7172287cc11064b1e667b71e8087093e13bdf36.tar.gz
external_webkit-f7172287cc11064b1e667b71e8087093e13bdf36.tar.bz2
Merge "Fix SIGBUG due to misalignment" into jb-mr1-dev
-rw-r--r--Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp6
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);