title: glDrawArrays crash on enabling color vertex array OpenGL ES 2.0
body: <p>Code below is working fine and draw a colored triangle equal sides:</p>
  
  <pre><code>GLfloat triangle_pos[] =
                   {
              -0.5, -0.25, 0.0,
               0.5, -0.25, 0.0,
               0.0, 0.559016994, 0.0
                   };
  
  void draw_triangle()
  {
   glUseProgram(SHADER.program);
  
   matrix mv;
   multiply_matrix(VIEW_MATRIX/*ident*/, MODEL_MATRIX/*ident*/, mv);
   matrix mvp;
   multiply_matrix(PROJECTION_MATRIX/*ortho*/, mv, mvp);
  
   glUniformMatrix4fv(SHADER.uniforms[0]/*um_mvp*/, 1, GL_FALSE, mvp);
  
   glEnableVertexAttribArray(SHADER.atributes[0]/*av_pos*/);
   glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, triangle_pos);
  
   glDrawArrays(GL_TRIANGLES, 0, 3);
  
   glDisableVertexAttribArray(SHADER.atributes[0]/*av_pos*/);
  
   glUseProgram(0);
  }
  </code></pre>
  
  <p>Vertex shader:</p>
  
  <pre><code>attribute vec4 av_pos;
  varying vec4 vv_col;
  uniform mat4 um_mvp;
  void main()
  {
   vv_col = um_mvp * av_pos;
   gl_Position = vv_col; 
  } 
  </code></pre>
  
  <p>Fragment shader:</p>
  
  <pre><code>precision lowp float;
  varying vec4 vv_col;
  void main()
  {
   gl_FragColor = vv_col;
  }   
  </code></pre>
  
  <p>Lets change vertex shader to load color values from outside:</p>
  
  <pre><code>attribute vec4 av_pos;
  attribute vec4 av_col;
  varying vec4 vv_col;
  uniform mat4 um_mvp;
  void main()
  {
   vv_col = av_col
   gl_Position = um_mvp * av_pos; 
  }  
  </code></pre>
  
  <p>And modified code will be:</p>
  
  <pre><code>GLfloat triangle_pos[] =
                   {
              -0.5, -0.25, 0.0,
               0.5, -0.25, 0.0,
               0.0, 0.559016994, 0.0
                   };
  
  GLfloat triangle_col[]=
                   {
      1.0,0.0,1.0,1.0,
      0.0,1.0,1.0,1.0,
      1.0,0.0,0.0,1.0
                   };
  
  
  
  void draw_triangle()
  {
   glUseProgram(SHADER.program);
  
   matrix mv;
   multiply_matrix(VIEW_MATRIX, MODEL_MATRIX, mv);
   matrix mvp;
   multiply_matrix(PROJECTION_MATRIX, mv, mvp);
  
   glUniformMatrix4fv(SHADER.uniforms[0]/*um_mvp*/, 1, GL_FALSE, mvp);
  
   glEnableVertexAttribArray(SHADER.atributes[0]/*av_pos*/);
   glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, triangle_pos);
  
   glEnableVertexAttribArray(SHADER.atributes[1]/*av_col*/);
   glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, triangle_col);
  
   glDrawArrays(GL_TRIANGLES, 0, 3); // just crashing i can't even glGetError() after that line
  
   glDisableVertexAttribArray(SHADER.atributes[0]);
  
   glDisableVertexAttribArray(SHADER.atributes[1]);
  
   glUseProgram(0);
  }
  </code></pre>
  
  <p>Why glDrawArrays crash and how to fix that?</p>