From fb06b7a5510e4c6f6c4b3cd51cca22493cd258ca Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Wed, 13 Jul 2011 16:09:42 -0700 Subject: Fix native crash when GL driver fails to initialize. Change-Id: I85714de9029285027dc75fb3b62076be41a4c985 --- libs/rs/rsContext.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libs/rs') diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index 44e9d89..8798612 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -693,7 +693,9 @@ RsContext rsContextCreateGL(RsDevice vdev, uint32_t version, LOGV("rsContextCreateGL %p", vdev); Device * dev = static_cast(vdev); Context *rsc = Context::createContext(dev, &sc); - rsc->setDPI(dpi); + if (rsc) { + rsc->setDPI(dpi); + } LOGV("rsContextCreateGL ret %p ", rsc); return rsc; } -- cgit v1.1