fix memory access error in vbo_bind_vertex_list
[mesa.git] / src / mesa / vbo / vbo_save_api.c
index c08fd1fe555ba26a9321cd7e6b30c8e11bc7d301..f62be5c14cf4bb7960354998c52fb164861fa072 100644 (file)
@@ -67,19 +67,23 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
 
-#include "glheader.h"
-#include "context.h"
-#include "dlist.h"
-#include "enums.h"
-#include "macros.h"
-#include "api_validate.h"
-#include "api_arrayelt.h"
-#include "vtxfmt.h"
-#include "dispatch.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/dlist.h"
+#include "main/enums.h"
+#include "main/macros.h"
+#include "main/api_validate.h"
+#include "main/api_arrayelt.h"
+#include "main/vtxfmt.h"
+#include "glapi/dispatch.h"
 
 #include "vbo_context.h"
 
 
+#ifdef ERROR
+#undef ERROR
+#endif
+
 
 /*
  * NOTE: Old 'parity' issue is gone, but copying can still be
@@ -860,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) {