Error checking for MVP matrix computation.
Fixing more padding bugs.

Change-Id: Ic5d4260027b7dc86a50fdab7221c7296c7d3ea0d
diff --git a/rsProgramVertex.cpp b/rsProgramVertex.cpp
index c3ef356..918625c 100644
--- a/rsProgramVertex.cpp
+++ b/rsProgramVertex.cpp
@@ -108,6 +108,11 @@
     rsc->checkError("ProgramVertex::setupGL2 start");
 
     if(!isUserProgram()) {
+        if(mConstants[0].get() == NULL) {
+            LOGE("Unable to set fixed function emulation matrices because allocation is missing");
+            rsc->setError(RS_ERROR_BAD_SHADER, "Fixed function allocation missing");
+            return;
+        }
         float *f = static_cast<float *>(mConstants[0]->getPtr());
         Matrix mvp;
         mvp.load(&f[RS_PROGRAM_VERTEX_PROJECTION_OFFSET]);