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

Unified Diff: src/gpu/SkGr.cpp

Issue 1157363004: Fix NULL access (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index a87caf7a708ccbb1fdef30ad76fb72978a47fb1b..332f084c5b0193467264a806bcc70f3235a5dc3e 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -116,14 +116,18 @@ static void get_stretch(const GrContext* ctx, int width, int height,
stretch->fHeight = SkTMax(height, ctx->caps()->minTextureSize());
}
if (doStretch) {
- switch(params->filterMode()) {
- case GrTextureParams::kNone_FilterMode:
- stretch->fType = Stretch::kNearest_Type;
- break;
- case GrTextureParams::kBilerp_FilterMode:
- case GrTextureParams::kMipMap_FilterMode:
- stretch->fType = Stretch::kBilerp_Type;
- break;
+ if (params) {
+ switch(params->filterMode()) {
+ case GrTextureParams::kNone_FilterMode:
+ stretch->fType = Stretch::kNearest_Type;
+ break;
+ case GrTextureParams::kBilerp_FilterMode:
+ case GrTextureParams::kMipMap_FilterMode:
+ stretch->fType = Stretch::kBilerp_Type;
+ break;
+ }
+ } else {
+ stretch->fType = Stretch::kBilerp_Type;
}
} else {
stretch->fWidth = -1;
« 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