fix some aspects of [2258746] native crash in launcher2
Surface::validate() could sometimes dereference a null pointer before checking it wasn't null.
This will prevent the application to crash when given bad parameters or used incorrectly.
However, the bug above probably has another cause.
diff --git a/include/ui/Surface.h b/include/ui/Surface.h
index 70303cd..008c297 100644
--- a/include/ui/Surface.h
+++ b/include/ui/Surface.h
@@ -109,7 +109,7 @@
~SurfaceControl();
- status_t validate(SharedClient const* cblk) const;
+ status_t validate() const;
void destroy();
sp<SurfaceComposerClient> mClient;
@@ -190,7 +190,7 @@
status_t getBufferLocked(int index, int usage);
- status_t validate(SharedClient const* cblk) const;
+ status_t validate() const;
inline const GraphicBufferMapper& getBufferMapper() const { return mBufferMapper; }
inline GraphicBufferMapper& getBufferMapper() { return mBufferMapper; }