diff options
author | Greg Daniel <egdaniel@google.com> | 2018-04-03 14:03:15 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-03 18:51:40 +0000 |
commit | 4eda8d9fb3bd304a26ec8332e2410f97a3131e68 (patch) | |
tree | 184d1766512ede38217d14ca6e41b8260e9dca62 /src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp | |
parent | e11382bde0f259983d51fa4427242d9988c9d027 (diff) |
Check for divide by zero in fill_in_2D_gaussian_kernel
Same change as the 1D one, but now with more dimensions!!
Bug: skia:7769
Change-Id: I152031780ab71ba106d4fa65d52960ec4358274e
Reviewed-on: https://skia-review.googlesource.com/118262
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp')
-rw-r--r-- | src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp index 121e225796..fdd4990328 100644 --- a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp +++ b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp @@ -177,7 +177,7 @@ void GrGLConvolutionEffect::GenKey(const GrProcessor& processor, const GrShaderC /////////////////////////////////////////////////////////////////////////////// static void fill_in_1D_gaussian_kernel(float* kernel, int width, float gaussianSigma, int radius) { - float twoSigmaSqrd = 2.0f * gaussianSigma * gaussianSigma; + const float twoSigmaSqrd = 2.0f * gaussianSigma * gaussianSigma; if (SkScalarNearlyZero(twoSigmaSqrd, SK_ScalarNearlyZero)) { for (int i = 0; i < width; ++i) { kernel[i] = 0.0f; |