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

Unified Diff: src/effects/SkMorphologyImageFilter.cpp

Issue 473283002: Check all scratch texture allocations for image filters. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMorphologyImageFilter.cpp
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 49df654316d8637b15e14397e270151875492f2a..67769f29b93c2efe2468071133ec7ceb7212e0ca 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -506,6 +506,9 @@ bool apply_morphology(const SkBitmap& input,
if (radius.fWidth > 0) {
GrAutoScratchTexture ast(context, desc);
+ if (NULL == ast.texture()) {
+ return false;
+ }
GrContext::AutoRenderTarget art(context, ast.texture()->asRenderTarget());
apply_morphology_pass(context, src, srcRect, dstRect, radius.fWidth,
morphType, Gr1DKernelEffect::kX_Direction);
@@ -519,6 +522,9 @@ bool apply_morphology(const SkBitmap& input,
}
if (radius.fHeight > 0) {
GrAutoScratchTexture ast(context, desc);
+ if (NULL == ast.texture()) {
+ return false;
+ }
GrContext::AutoRenderTarget art(context, ast.texture()->asRenderTarget());
apply_morphology_pass(context, src, srcRect, dstRect, radius.fHeight,
morphType, Gr1DKernelEffect::kY_Direction);
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698