Fix an error in _save_OBE_DrawElements
authorXiang, Haihao <haihao.xiang@intel.com>
Mon, 30 Jul 2007 16:11:22 +0000 (00:11 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 30 Jul 2007 16:11:22 +0000 (00:11 +0800)
In the case that a buffer object is bound to
ELEMENT_ARRARY_BUFFER, it is invalid to directly
dereference indices passed to glDrawElements.

src/mesa/vbo/vbo_save_api.c

index aded73814361e462aac8897bd68b2bf6fde48f71..f62be5c14cf4bb7960354998c52fb164861fa072 100644 (file)
@@ -864,6 +864,9 @@ static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum
 
    _ae_map_vbos( ctx );
 
+   if (ctx->Array.ElementArrayBufferObj->Name)
+      indices = ADD_POINTERS(ctx->Array.ElementArrayBufferObj->Pointer, indices);
+
    vbo_save_NotifyBegin( ctx, mode | VBO_SAVE_PRIM_WEAK );
 
    switch (type) {