Don't try to set gamma treatment if texture creation fails.
authorbrianosman <brianosman@google.com>
Fri, 17 Jun 2016 14:03:45 +0000 (07:03 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 17 Jun 2016 14:03:45 +0000 (07:03 -0700)
Guessing this will fix the valgrind failure.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2075133002

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

src/gpu/SkGr.cpp

index befdc83..60fcdd5 100644 (file)
@@ -394,7 +394,9 @@ GrTexture* GrGenerateMipMapsAndUploadToTexture(GrContext* ctx, const SkBitmap& b
                                                                             SkBudgeted::kYes,
                                                                             texels.get(),
                                                                             mipLevelCount);
-        texture->texturePriv().setGammaTreatment(gammaTreatment);
+        if (texture) {
+            texture->texturePriv().setGammaTreatment(gammaTreatment);
+        }
         return texture;
     }
 }