aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-06-01 10:22:48 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-01 10:22:48 -0700
commit0513c83e0f6bffa566c7d1b93fb2ba52bacc10fc (patch)
treeb2950c0463b08b7477823dbcb94f4ff7d658626c /src/gpu
parentc00e1dd93d2c0e3ce6c76c38ccb75de5ddb9663c (diff)
Fix NULL access
BUG=skia: TBR=egdaniel@google.com Review URL: https://codereview.chromium.org/1157363004
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/SkGr.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index a87caf7a70..332f084c5b 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;