From 7215b5115ed8c34448b502dbfae1efa295c0a1e5 Mon Sep 17 00:00:00 2001 From: Alex Sakhartchouk Date: Mon, 27 Sep 2010 10:29:47 -0700 Subject: Error checking for MVP matrix computation. Fixing more padding bugs. Change-Id: Ic5d4260027b7dc86a50fdab7221c7296c7d3ea0d --- libs/rs/rsProgramVertex.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libs/rs/rsProgramVertex.cpp') diff --git a/libs/rs/rsProgramVertex.cpp b/libs/rs/rsProgramVertex.cpp index c3ef356..918625c 100644 --- a/libs/rs/rsProgramVertex.cpp +++ b/libs/rs/rsProgramVertex.cpp @@ -108,6 +108,11 @@ void ProgramVertex::setupGL2(Context *rsc, ProgramVertexState *state, ShaderCach 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(mConstants[0]->getPtr()); Matrix mvp; mvp.load(&f[RS_PROGRAM_VERTEX_PROJECTION_OFFSET]); -- cgit v1.1