From: Mathias Fröhlich <mathias.froehl...@gmx.net>

Set the _DrawArray pointer to NULL when calling into the Drivers
Bitmap/CopyPixels/DrawPixels hooks. This fixes an assert that gets
uncovered with the following patch gets applied.

Signed-off-by: Mathias Fröhlich <mathias.froehl...@web.de>
---
 src/mesa/main/drawpix.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index ec1d2618ca..05a18d3e51 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -37,6 +37,7 @@
 #include "dispatch.h"
 #include "glformats.h"
 #include "fbobject.h"
+#include "varray.h"
 
 
 /*
@@ -72,6 +73,9 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
     */
    _mesa_set_vp_override(ctx, GL_TRUE);
 
+   /* Prevent drivers from accessing stale draw array data */
+   _mesa_set_drawing_arrays(ctx, NULL);
+
    /* Note: this call does state validation */
    if (!_mesa_valid_to_render(ctx, "glDrawPixels")) {
       goto end;      /* the error code was recorded */
@@ -228,6 +232,9 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, 
GLsizei height,
     */
    _mesa_set_vp_override(ctx, GL_TRUE);
 
+   /* Prevent drivers from accessing stale draw array data */
+   _mesa_set_drawing_arrays(ctx, NULL);
+
    /* Note: this call does state validation */
    if (!_mesa_valid_to_render(ctx, "glCopyPixels")) {
       goto end;      /* the error code was recorded */
@@ -320,6 +327,9 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
    if (ctx->RasterDiscard)
       return;
 
+   /* Prevent drivers from accessing stale draw array data */
+   _mesa_set_drawing_arrays(ctx, NULL);
+
    if (ctx->RenderMode == GL_RENDER) {
       /* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */
       if (width > 0 && height > 0) {
-- 
2.14.3

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to