Check for abandoned texture in GrTextureAdjuster::refTextureSafeForParams
authorbsalomon <bsalomon@google.com>
Wed, 15 Jun 2016 16:25:22 +0000 (09:25 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 15 Jun 2016 16:25:22 +0000 (09:25 -0700)
Cherry-pick for M52

BUG=chromium:618858
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2063313002

TBR=egdaniel@google.com

Review-Url: https://codereview.chromium.org/2063313002
NOTREECHECKS=true
NOTRY=true
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2066493006

src/gpu/GrTextureParamsAdjuster.cpp

index a91ba8a5e37e65199944393bc30767d60c919cbc..1d061375d9e70cc6469de644e72002f1d2c405f4 100644 (file)
@@ -164,6 +164,11 @@ GrTexture* GrTextureAdjuster::refTextureSafeForParams(const GrTextureParams& par
     CopyParams copyParams;
     const SkIRect* contentArea = this->contentAreaOrNull();
 
+    if (!context) {
+        // The texture was abandoned.
+        return nullptr;
+    }
+
     if (contentArea && GrTextureParams::kMipMap_FilterMode == params.filterMode()) {
         // If we generate a MIP chain for texture it will read pixel values from outside the content
         // area.