Index: src/effects/SkMatrixConvolutionImageFilter.cpp |
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp |
index ae29bcb01b338a0397e183dce4185b113c48f637..cdcf66f6921ec939b42460301a5b7a94b58da36b 100644 |
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp |
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp |
@@ -67,6 +67,10 @@ SkMatrixConvolutionImageFilter* SkMatrixConvolutionImageFilter::Create( |
if (!kernel) { |
return NULL; |
} |
+ if ((kernelOffset.fX < 0) || (kernelOffset.fX >= kernelSize.fWidth) || |
+ (kernelOffset.fY < 0) || (kernelOffset.fY >= kernelSize.fHeight)) { |
+ return NULL; |
+ } |
return SkNEW_ARGS(SkMatrixConvolutionImageFilter, (kernelSize, kernel, gain, bias, |
kernelOffset, tileMode, convolveAlpha, |
input, cropRect, uniqueID)); |