OSDN Git Service

Fix native crash when GL driver fails to initialize.
authorJason Sams <rjsams@android.com>
Wed, 13 Jul 2011 23:09:42 +0000 (16:09 -0700)
committerJason Sams <rjsams@android.com>
Wed, 13 Jul 2011 23:09:42 +0000 (16:09 -0700)
Change-Id: I85714de9029285027dc75fb3b62076be41a4c985

libs/rs/rsContext.cpp

index 44e9d89..8798612 100644 (file)
@@ -693,7 +693,9 @@ RsContext rsContextCreateGL(RsDevice vdev, uint32_t version,
     LOGV("rsContextCreateGL %p", vdev);
     Device * dev = static_cast<Device *>(vdev);
     Context *rsc = Context::createContext(dev, &sc);
-    rsc->setDPI(dpi);
+    if (rsc) {
+        rsc->setDPI(dpi);
+    }
     LOGV("rsContextCreateGL ret %p ", rsc);
     return rsc;
 }