aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ImageIsOpaqueTest.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-12-15 06:41:02 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-15 06:41:02 -0800
commit7534cf1703b66a742217d870aa7b87bdbc75e760 (patch)
treefedbc1bf367c9f78ad4c8de69ba796679ae56bb2 /tests/ImageIsOpaqueTest.cpp
parent912ed6ebb8e2813e72ed7a3dec3b6710ba7e7405 (diff)
ensure 4-byte alignment for storage, as SkWriterBuffer requires it
Diffstat (limited to 'tests/ImageIsOpaqueTest.cpp')
-rw-r--r--tests/ImageIsOpaqueTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ImageIsOpaqueTest.cpp b/tests/ImageIsOpaqueTest.cpp
index 6fdbc8127a..6d886d48bf 100644
--- a/tests/ImageIsOpaqueTest.cpp
+++ b/tests/ImageIsOpaqueTest.cpp
@@ -17,8 +17,8 @@
#include "SkWriteBuffer.h"
static void test_flatten(skiatest::Reporter* reporter, const SkImageInfo& info) {
- // just need a safe amount of storage
- char storage[sizeof(SkImageInfo)*2];
+ // just need a safe amount of storage, but ensure that it is 4-byte aligned.
+ int32_t storage[(sizeof(SkImageInfo)*2) / sizeof(int32_t)];
SkWriteBuffer wb(storage, sizeof(storage));
info.flatten(wb);
SkASSERT(wb.bytesWritten() < sizeof(storage));