Added missing validation

BUG=433359

Review URL: https://codereview.chromium.org/729583002
This commit is contained in:
sugoi 2014-11-17 05:45:55 -08:00 committed by Commit bot
parent 0a81f1ee0e
commit 1379b87ae4

View File

@ -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));