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

Unified Diff: src/effects/SkMatrixConvolutionImageFilter.cpp

Issue 319003002: Adding kernel offset validation (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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/effects/SkMatrixConvolutionImageFilter.cpp
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index 8ae837755fe9c8924c07313d1694732ab454fcfd..89e113b8cea9867fb70c99dfcbbe9db532b4718f 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -86,7 +86,9 @@ SkMatrixConvolutionImageFilter::SkMatrixConvolutionImageFilter(SkReadBuffer& buf
buffer.validate((fKernel != 0) &&
SkScalarIsFinite(fGain) &&
SkScalarIsFinite(fBias) &&
- tile_mode_is_valid(fTileMode));
+ tile_mode_is_valid(fTileMode) &&
+ (fKernelOffset.fX >= 0) && (fKernelOffset.fX < fKernelSize.fWidth) &&
+ (fKernelOffset.fY >= 0) && (fKernelOffset.fY < fKernelSize.fHeight));
}
void SkMatrixConvolutionImageFilter::flatten(SkWriteBuffer& buffer) const {
« 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