Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(564)

Unified Diff: src/gpu/effects/GrConvolutionEffect.cpp

Issue 23340003: Fix stack buffer read overflow in GrConvolutionEffect::TestCreate. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Avoid signed / unsigned comparison. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrConvolutionEffect.cpp
===================================================================
--- src/gpu/effects/GrConvolutionEffect.cpp (revision 10813)
+++ src/gpu/effects/GrConvolutionEffect.cpp (working copy)
@@ -227,8 +227,8 @@
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];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698