OSDN Git Service

[validation] Check null buf before printing validation info
authorLingfeng Yang <lfy@google.com>
Wed, 18 Jan 2017 17:26:19 +0000 (09:26 -0800)
committerLingfeng Yang <lfy@google.com>
Wed, 18 Jan 2017 19:01:00 +0000 (19:01 +0000)
Change-Id: I2ba7c4c694ad4a75a6e68722e3fd7cde05a47a0f

system/GLESv2_enc/GL2Encoder.cpp

index 9027b7a..c45249b 100755 (executable)
@@ -934,10 +934,12 @@ void GL2Encoder::sendVertexAttributes(GLint first, GLsizei count, bool hasClient
                     }
                 } else {
                     ALOGE("a vertex attribute index out of boundary is detected. Skipping corresponding vertex attribute. buf=%p", buf);
-                    // ALOGE("Out of bounds vertex attribute info: "
-                    //       "clientArray? %d attribute %d vbo %u allocedBufferSize %u bufferDataSpecified? %d wantedStart %u wantedEnd %u",
-                    //       hasClientArrays, i, bufferObject, buf->m_size, buf != NULL, firstIndex, firstIndex + bufLen);
-                    // m_glDisableVertexAttribArray_enc(this, i);
+                    if (buf) {
+                        ALOGE("Out of bounds vertex attribute info: "
+                                "clientArray? %d attribute %d vbo %u allocedBufferSize %u bufferDataSpecified? %d wantedStart %u wantedEnd %u",
+                                hasClientArrays, i, bufferObject, buf->m_size, buf != NULL, firstIndex, firstIndex + bufLen);
+                    }
+                    m_glDisableVertexAttribArray_enc(this, i);
                 }
             }
         } else {