From 7534cf1703b66a742217d870aa7b87bdbc75e760 Mon Sep 17 00:00:00 2001 From: reed Date: Mon, 15 Dec 2014 06:41:02 -0800 Subject: ensure 4-byte alignment for storage, as SkWriterBuffer requires it BUG=skia:3244 Review URL: https://codereview.chromium.org/805803002 --- tests/ImageIsOpaqueTest.cpp | 4 ++-- 1 file 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)); -- cgit v1.2.3