SkReader32::setMemory() requires 4-byte alignment

We've just been getting lucky that the char[] was 4-byte aligned.

Change-Id: I550be24b0e6f074a38ef002b6b10fbdc5cdfcf2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255557
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
This commit is contained in:
Mike Klein 2019-11-20 13:48:15 -06:00 committed by Skia Commit-Bot
parent 73dbea669b
commit 4a627011ea

View File

@ -81,7 +81,7 @@ DEF_TEST(Reader32, reporter) {
// need to handle read(null, 0) and not get undefined behavior from memcpy
{
char storage[100];
uint32_t storage[100 / sizeof(uint32_t)];
reader.setMemory(storage, sizeof(storage));
char buffer[10];
reader.read(buffer, 0); // easy case, since we pass a ptr