aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/StreamTest.cpp
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-08-19 06:12:40 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-19 06:12:40 -0700
commitcb9241baddcca38aa80e43125dc72a99b98bb8ef (patch)
tree5abb6fcb8056bbceaae77411e7d29ca592c86042 /tests/StreamTest.cpp
parentf3bf892d71e3d16d95e035e06a6ad2fee16479c9 (diff)
Fix stack overuse error
Diffstat (limited to 'tests/StreamTest.cpp')
-rw-r--r--tests/StreamTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp
index 78c0e506db..08adf142c1 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);
}