Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(517)

Unified Diff: tests/ImageIsOpaqueTest.cpp

Issue 805803002: ensure 4-byte alignment for storage, as SkWriterBuffer requires it (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageIsOpaqueTest.cpp
diff --git a/tests/ImageIsOpaqueTest.cpp b/tests/ImageIsOpaqueTest.cpp
index 6fdbc8127abf4a4165c238393771af29f5cd78bd..6d886d48bfb19e05b40cb4e8f5dab86f58dcea24 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));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698