Index: tests/StreamTest.cpp |
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp |
index 78c0e506db47cc77725f8a2b29cf72440bc65c79..08adf142c10313bb0f1b4983556db9ec025387a4 100644 |
--- a/tests/StreamTest.cpp |
+++ b/tests/StreamTest.cpp |
@@ -381,15 +381,15 @@ static void stream_copy_test(skiatest::Reporter* reporter, |
DEF_TEST(StreamCopy, reporter) { |
SkRandom random(123456); |
- static const size_t N = 10000; |
- uint8_t src[N]; |
- for (size_t j = 0; j < N; ++j) { |
+ static const int N = 10000; |
+ SkAutoTMalloc<uint8_t> src((size_t)N); |
+ for (int j = 0; j < N; ++j) { |
src[j] = random.nextU() & 0xff; |
} |
// SkStreamCopy had two code paths; this test both. |
- DumbStream dumbStream(src, N); |
+ DumbStream dumbStream(src.get(), (size_t)N); |
stream_copy_test(reporter, src, N, &dumbStream); |
- SkMemoryStream smartStream(src, N); |
+ SkMemoryStream smartStream(src.get(), (size_t)N); |
stream_copy_test(reporter, src, N, &smartStream); |
} |