From 15a0515c89e17bb6b914601d7edba63a7cc3def3 Mon Sep 17 00:00:00 2001 From: bsalomon Date: Wed, 15 Jun 2016 09:25:22 -0700 Subject: [PATCH] Check for abandoned texture in GrTextureAdjuster::refTextureSafeForParams 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gpu/GrTextureParamsAdjuster.cpp b/src/gpu/GrTextureParamsAdjuster.cpp index a91ba8a..1d06137 100644 --- a/src/gpu/GrTextureParamsAdjuster.cpp +++ b/src/gpu/GrTextureParamsAdjuster.cpp @@ -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. -- 2.7.4