diff options
author | 2016-03-09 09:52:45 -0800 | |
---|---|---|
committer | 2016-03-09 09:52:45 -0800 | |
commit | 7467ab8cc0818008649f043fb98127c929c2eb37 (patch) | |
tree | c8beb8aed618c6de0ab6bef7e3d7248c349708e1 /src | |
parent | 2ad1aa67c6894696cdd65ec56057f81031d1c24a (diff) |
Fix nullptr access in GrTextureProvider::createMipMappedTexture
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1777013002
Review URL: https://codereview.chromium.org/1777013002
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrTextureProvider.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gpu/GrTextureProvider.cpp b/src/gpu/GrTextureProvider.cpp index f1775aba78..3596ba6c12 100644 --- a/src/gpu/GrTextureProvider.cpp +++ b/src/gpu/GrTextureProvider.cpp @@ -53,12 +53,12 @@ GrTexture* GrTextureProvider::createMipMappedTexture(const GrSurfaceDesc& desc, if (!GrPixelConfigIsCompressed(desc.fConfig) && !desc.fTextureStorageAllocator.fAllocateTextureStorage) { if (mipLevelCount < 2) { - const GrMipLevel& baseMipLevel = texels[0]; static const uint32_t kFlags = kExact_ScratchTextureFlag | kNoCreate_ScratchTextureFlag; if (GrTexture* texture = this->refScratchTexture(desc, kFlags)) { - if (!texels || texture->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig, - baseMipLevel.fPixels, baseMipLevel.fRowBytes)) { + if (!mipLevelCount || + texture->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig, + texels[0].fPixels, texels[0].fRowBytes)) { if (SkBudgeted::kNo == budgeted) { texture->resourcePriv().makeUnbudgeted(); } |