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
This commit is contained in:
parent
8700295fba
commit
4348663da8
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user