Add null check to createPlatformTexture

Review URL: http://codereview.appspot.com/5498100/



git-svn-id: http://skia.googlecode.com/svn/trunk@2949 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 1761345..8a7d3e4 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -196,6 +196,9 @@
 GrTexture* GrGpu::createPlatformTexture(const GrPlatformTextureDesc& desc) {
     this->handleDirtyContext();
     GrTexture* tex = this->onCreatePlatformTexture(desc);
+    if (NULL == tex) {
+        return NULL;
+    }
     // TODO: defer this and attach dynamically
     GrRenderTarget* tgt = tex->asRenderTarget();
     if (NULL != tgt &&