diff options
author | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-20 15:20:34 +0000 |
---|---|---|
committer | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-20 15:20:34 +0000 |
commit | 4348663da8271f4b72594a0f5aa84036e6ee327b (patch) | |
tree | 5d522d267d0f8fcf6689c8f5c24ed6658e703491 /src | |
parent | 8700295fbaaf77a29d3133506a6eafcc993b4b1a (diff) |
Fix stack buffer read overflow in GrConvolutionEffect::TestCreate.
BUG=skia:1532
R=bsalomon@google.com, robertphillips@google.com
Review URL: https://codereview.chromium.org/23340003
git-svn-id: http://skia.googlecode.com/svn/trunk@10816 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/effects/GrConvolutionEffect.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp index aad7d4938d..925a8188f6 100644 --- a/src/gpu/effects/GrConvolutionEffect.cpp +++ b/src/gpu/effects/GrConvolutionEffect.cpp @@ -227,12 +227,12 @@ GrEffectRef* GrConvolutionEffect::TestCreate(SkMWCRandom* random, GrEffectUnitTest::kAlphaTextureIdx; Direction dir = random->nextBool() ? kX_Direction : kY_Direction; int radius = random->nextRangeU(1, kMaxKernelRadius); - float kernel[kMaxKernelRadius]; - for (int i = 0; i < kMaxKernelRadius; ++i) { + float kernel[kMaxKernelWidth]; + for (size_t i = 0; i < SK_ARRAY_COUNT(kernel); ++i) { kernel[i] = random->nextSScalar1(); } float bounds[2]; - for (int i = 0; i < 2; ++i) { + for (size_t i = 0; i < SK_ARRAY_COUNT(bounds); ++i) { bounds[i] = random->nextF(); } |