aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-03-09 09:52:45 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-09 09:52:45 -0800
commit7467ab8cc0818008649f043fb98127c929c2eb37 (patch)
treec8beb8aed618c6de0ab6bef7e3d7248c349708e1 /src
parent2ad1aa67c6894696cdd65ec56057f81031d1c24a (diff)
Fix nullptr access in GrTextureProvider::createMipMappedTexture
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrTextureProvider.cpp6
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();
}